MySQL安全配置向导mysql_secure_installation详解
2023-06-13 09:15:19 时间
安装完mysql-server会提示可以运行mysql_secure_installation。运行mysql_secure_installation会执行几个设置:
a)为root用户设置密码
b)删除匿名账号
c)取消root用户远程登录
d)删除test库和对test库的访问权限
e)刷新授权表使修改生效
通过这几项的设置能够提高mysql库的安全。建议生产环境中mysql安装这完成后一定要运行一次mysql_secure_installation,详细步骤请参看下面的命令:
[root@server1~]#mysql_secure_installation
NOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMySQL
SERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY!
InordertologintoMySQLtosecureit,we"llneedthecurrent
passwordfortherootuser.Ifyou"vejustinstalledMySQL,and
youhaven"tsettherootpasswordyet,thepasswordwillbeblank,
soyoushouldjustpressenterhere.
Entercurrentpasswordforroot(enterfornone):
OK,successfullyusedpassword,movingon…
SettingtherootpasswordensuresthatnobodycanlogintotheMySQL
rootuserwithouttheproperauthorisation.
Setrootpassword?[Y/n]
Newpassword:
Re-enternewpassword:
Passwordupdatedsuccessfully!
Reloadingprivilegetables..
…Success!
Bydefault,aMySQLinstallationhasananonymoususer,allowinganyone
tologintoMySQLwithouthavingtohaveauseraccountcreatedfor
them.Thisisintendedonlyfortesting,andtomaketheinstallation
goabitsmoother.Youshouldremovethembeforemovingintoa
productionenvironment.
Removeanonymoususers?[Y/n]
…Success!
Normally,rootshouldonlybeallowedtoconnectfrom"localhost".This
ensuresthatsomeonecannotguessattherootpasswordfromthenetwork.
Disallowrootloginremotely?[Y/n]
…Success!
Bydefault,MySQLcomeswithadatabasenamed"test"thatanyonecan
access.Thisisalsointendedonlyfortesting,andshouldberemoved
beforemovingintoaproductionenvironment.
Removetestdatabaseandaccesstoit?[Y/n]
-Droppingtestdatabase…
…Success!
-Removingprivilegesontestdatabase…
…Success!
Reloadingtheprivilegetableswillensurethatallchangesmadesofar
willtakeeffectimmediately.
Reloadprivilegetablesnow?[Y/n]
…Success!
Cleaningup…
Alldone!Ifyou"vecompletedalloftheabovesteps,yourMySQL
installationshouldnowbesecure.
ThanksforusingMySQL!
[root@server1~]#
相关文章
- mysql 提升tps_MYSQL的TPS优化
- MySQL Error number: MY-011220; Symbol: ER_AUDIT_LOG_FILTER_FAILED_TO_UPDATE_TABLE; SQLSTATE: HY000 报错 故障修复 远程处理
- 安全起见:关闭MySQL远程连接(关闭mysql远程连接)
- MySQL数据的安全回滚(mysql回滚数据)
- MySQL用户:如何查看?(查看mysql中的用户)
- MySQL连接日志:跟踪系统性能和安全(mysql连接日志)
- Mac下MySQL的安装及配置指南(mac如何配置mysql)
- MySQL JDBC 配置:一步一步构建持久连接。(mysql的jdbc配置)
- MySQL: 不仅仅是’=’!(mysql不等于)
- 更改MySQL表格引擎:一步一步来(修改mysql表的引擎)
- 深入理解MySQL目录树:掌握数据文件及各参数配置(mysql目录树)
- 安全实施MySQL:十步曲安装过程(mysql安装过程)
- MySQL连接:建立数据库间的联系(mysql连接)
- MySQL数据库精通:百度网盘免费课程(mysql教程百度网盘)
- MySQL如何安全关闭?(mysql如何关闭)
- MySQL配置指南:一步步跟着做!(mysql的配置向导)
- MySQL中如何使用year函数获取年份(mysql中year())
- MySQL中的BITINT数据类型详解(mysql中bitint)
- 两步确保MySQL密码安全(2个mysql设置密码)
- MySQL实现一次性高效全面查询(mysql一次全查)
- Mysql高效查询表的二次连接实现(mysql一张表二次连接)
- 同一数据库,不同服务器,MySQL有何不同(mysql不同服务器吗)
- mysql无需绑定IP,轻松配置访问安全(mysql不绑定ip)
- 离线使用MySQL可行性分析及实现方法(mysql一定要联网吗)