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?
基础教程推荐
- SQL Server 2016更改对象所有者 2022-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01