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?
基础教程推荐
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在多列上分布任意行 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
