mysql如何删掉匿名账户_mysql下删除匿名帐户

password for the root user.  If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n

... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n

... skipping.

By default, MySQL comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] n

... skipping.

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

3:删除后的抓图如下:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: MySQL在Linux系统下的初始化过程如下: 1. 安装MySQL服务器。 2. 使用root用户登录系统,运行命令"mysql_secure_installation"来初始化MySQL。 3. 按照提示输入root用户的密码。 4. 选择是否要设置root用户的密码。 5. 选择是否要删除匿名用户。 6. 选择是否要禁止root用户远程登录。 7. 选择是否要删除test数据库。 8. 选择是否要重新加载权限表。 在上述步骤完成之后,MySQL就已经初始化完毕。 ### 回答2: 在Linux下初始化MySQL,有以下几个主要步骤: 1. 安装MySQL:首先需要从MySQL官方网站下载适合Linux系统的MySQL安装包,然后通过命令行或者图形界面使用包管理工具安装MySQL。 2. 修改配置文件:安装完成后,需要修改MySQL的配置文件my.cnf。在Linux上,该文件通常位于/etc/mysql/my.cnf。可以通过编辑该文件,修改MySQL的配置参数,如端口号、字符集等。 3. 启动MySQL服务:在完成安装和配置后,可以使用以下命令来启动MySQL服务: ``` sudo service mysql start ``` 4. 设置root用户密码:初始安装完成后,MySQL的root用户没有密码。可以通过以下命令来设置root用户密码: ``` sudo mysql_secure_installation ``` 5. 远程访问设置(可选):如果需要在其他机器远程访问MySQL数据库,可以通过修改配置文件中的bind-address参数,将其设为0.0.0.0,允许所有IP地址访问MySQL服务。 6. 创建数据库和用户:在MySQL中,可以通过命令行或者可视化工具创建数据库和用户,管理数据库的权限等。使用以下命令可以登录MySQL控制台: ``` mysql -u root -p ``` 以上是在Linux下初始化MySQL的主要步骤。通过以上步骤,可以完成MySQL的安装、配置和启动,并可进行数据库和用户的相关操作。 ### 回答3: 在Linux下进行MySQL的初始化主要包括以下几个步骤。 1. 下载安装MySQL:首先要从MySQL官网下载适用于Linux系统的MySQL安装包,根据系统版本选择对应的安装包进行下载。下载完成后,按照官方文档提供的步骤进行安装。 2. 配置MySQL服务器:安装完成后,需要进行一些基本的配置,如修改配置文件my.cnf以设置数据库存储路径、字符集等参数。该文件通常位于/etc/mysql或/etc目录下,根据实际安装情况进行修改。 3. 初始化MySQL数据目录:在安装完成后,还需要初始化MySQL的数据目录,即创建MySQL数据库系统表空间。可以使用mysql_install_db命令进行初始化,根据实际情况使用合适的参数进行初始化。 4. 启动MySQL服务:初始化完成后,可以使用启动命令启动MySQL服务,如service mysql start或systemctl start mysql。启动成功后,可以使用mysql命令行工具连接到MySQL服务器。 5. 设置MySQL的root账户密码:连接到MySQL服务器后,可以使用ALTER USER语句设置root账户的密码,确保数据库的安全性。 以上是MySQL在Linux下进行初始化的基本步骤。根据具体情况还可以进行其他配置,如设置远程访问权限、开启防火墙等。在进行初始化之前,建议参考官方文档或相关教程以了解更多详细信息。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值