2026年11月1日 · 今日 0 帖 · 会员 6.1万 · 主题 17.4万
登录 · 注册 · 游客,欢迎随便逛逛
返回版块
只看作者:洞房 查看全部
1000
Lv9有为九子能等级图标
勋章勋章勋章勋章勋章
帖子
9.3万
回复
2,089
积分
60.3万
注册
2006-12-06
[怀旧国机]

MySQL安全知识:安全初始化MySQL

[复制链接]
查看 118 回复 0
楼主 发表于 | 查看全部
1 人收藏

mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current

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): #输入root口令,没有设置口令回车即可。

OK, successfully used password, moving on…

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

root user without the proper authorisation.

Set root password? y #设置mysql数据库root口令

New password:

Re-enter new password:

Password *d successfully!

Reloading privilege tables..

… Success!

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

to log into MySQL without having to have a user account *d 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 #删除mysql匿名用户

… 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 #阻止root用户远程访问mysql

… Success!

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 #删除测试数据库

- *ping test database…

… Success!

- Removing privileges on test database…

… Success!

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

will take effect immediately.

Reload privilege tables now? y #重新载入mysql权限

… 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!

登录回复

登录后可以回复这个帖子。旧账号可使用原密码登录。

登录 注册新号
← 返回版块