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?


- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01