千家信息网

分析mysqld的skip-grant-tables选项

发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,这篇文章主要讲解了"分析mysqld的skip-grant-tables选项",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"分析mysqld的skip-
千家信息网最后更新 2025年11月07日分析mysqld的skip-grant-tables选项

这篇文章主要讲解了"分析mysqld的skip-grant-tables选项",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"分析mysqld的skip-grant-tables选项"吧!

这个选项会导致不使用权限系统来启动服务器,它将让任何用户可以访问服务器并且不受限制的访问所有数据库。在不使用授权表启动服务器后可以通过shell来执行mysqladmin flush-privileges或mysqladmin reload命令或者在连接到服务器后执行flush privileges语句来让正在运行的服务器再次使用授权表。

使用--skip-grant-tables选项启动服务器

[root@localhost mysql]# service mysqld stopShutting down MySQL. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tablesStarting MySQL.. SUCCESS!

现在就可以不使用用户和密码就可以登录服务器

[mysql@localhost ~]$ mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

现在可以执行mysqladin flush-privileges命令让正在运行的服务器再次使用授权表

[mysql@localhost ~]$ mysqladmin  flush-privileges

现在不使用用户和密码就不能登录服务器了,必须使用用户和密码才能登录了

[mysql@localhost ~]$ mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[mysql@localhost ~]$ mysql -uroot -pabcd mysqlmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

再次使用--skip-grant-tables选项启动服务器

[root@localhost mysql]# service mysqld stopShutting down MySQL.. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tablesStarting MySQL.. SUCCESS!

现在就可以不使用用户和密码就可以登录服务器

[mysql@localhost ~]$ mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

现在可以执行mysqladin reload命令让正在运行的服务器再次使用授权表

mysql@localhost ~]$ mysqladmin reload

现在不使用用户和密码就不能登录服务器了,必须使用用户和密码才能登录了

[mysql@localhost ~]$ mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[mysql@localhost ~]$ mysql -uroot -pabcd mysqlmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

再次使用--skip-grant-tables选项启动服务器

[root@localhost mysql]# service mysqld stopShutting down MySQL. SUCCESS! [root@localhost mysql]# service mysqld start --skip-grant-tablesStarting MySQL.. SUCCESS!

现在就可以不使用用户和密码就可以登录服务器

[mysql@localhost ~]$ mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

现在可以执行flush privileges语句让正在运行的服务器再次使用授权表

mysql> flush privileges;Query OK, 0 rows affected (0.12 sec)

现在不使用用户和密码就不能登录服务器了,必须使用用户和密码才能登录了

[mysql@localhost ~]$ mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[mysql@localhost ~]$ mysql -uroot -pabcd mysqlmysql: [Warning] Using a password on the command line interface can be insecure.Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.26-log Source distributionCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

--skip-grant-tables选项也可以在选项文件my.cnf中进行设置。这个选项还会导致服务器在启动过程中禁止加载用户定义函数(udf),调度事件和安装插件语句中安装的插件。为了以任何方式来加载插件,使用--plugin-load选项。--skip-grant-tables选项也会导致disabled_storage_engines系统变量失效。

flush privileges语句可以在服务器启动后通过执行其它操作来隐式执行。例如在升级过程中mysql_upgrade程序就会刷新权限。

感谢各位的阅读,以上就是"分析mysqld的skip-grant-tables选项"的内容了,经过本文的学习后,相信大家对分析mysqld的skip-grant-tables选项这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!

服务器 服务 用户 密码 登录 再次 分析 正在 语句 运行 命令 插件 学习 内容 权限 系统 过程 事件 函数 变量 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 网络安全都转行了 河北通用软件开发定制价格 泰国服务器租用vps 泉州市公安网络安全员工资 富国科技互联网基金净值 重庆网络安全监管 银行有网络安全工程师有编制吗 数据库开发简介 平湖市数字引擎网络技术 三级网络技术属于 软件开发服务资质认证公司 魔兽世界转移服务器可以换种族吗 查询数据库数据文件位置 网络安全教育学习手册 数据库介质簇 招聘负责财务软件开发 网络安全是指在法律合规下 管理系统连接不到数据库 吉林 网络安全宣传周 医院网络安全自查和问题整改 笔记本网络安全类型选择 软件开发校园经历怎么写 宁波镇海区服务器硬盘 无发访问服务器失败咋回事快手 交通的调查数据库设计 数据库可以创建查询吗 lol国际服服务器状态 虹口区通用软件开发设计标准 金山云网络技术是金山的吗 木瓜互联网科技素材图片治愈
0