How to start MySQL with --skip-grant-tables?(如何使用 --skip-grant-tables 启动 MySQL?)
问题描述
我从我们的数据库中锁定了我的 root 用户.我需要将所有权限都归还给 root 用户.我有我的密码,我可以登录到 MySQL.但是root用户没有所有权限.
I locked my root user out from our database. I need to get all privileges back to the root user. I have my password and I can log in to MySQL. But the root user has no all privileges.
推荐答案
我遇到了与此问题标题相同的问题,因此如果其他人在 google 上搜索此问题并想在skip-grant-tables"中启动 MySqlWindows 上的模式,这就是我所做的.
I had the same problem as the title of this question, so incase anyone else googles upon this question and wants to start MySql in 'skip-grant-tables' mode on Windows, here is what I did.
通过管理员工具、服务停止 MySQL 服务.
Stop the MySQL service through Administrator tools, Services.
修改my.ini配置文件(假设默认路径)
Modify the my.ini configuration file (assuming default paths)
C:\Program Files\MySQL\MySQL Server 5.5\my.ini
或 MySQL 版本 >= 5.6
or for MySQL version >= 5.6
C:\ProgramData\MySQL\MySQL Server 5.6\my.ini
在服务器部分的 [mysqld] 下,添加以下行:
In the SERVER SECTION, under [mysqld], add the following line:
skip-grant-tables
所以你有
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
skip-grant-tables
再次启动该服务,您应该能够在没有密码的情况下登录到您的数据库.
Start the service again and you should be able to log into your database without a password.
这篇关于如何使用 --skip-grant-tables 启动 MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 --skip-grant-tables 启动 MySQL?


基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01