在尝试让远程 MySQL 工作时,我以某种方式设法使用 root 帐户将自己锁定。
通常,我会停止 MySQL 服务并使用 重新启动它/etc/init.d/mysql --init-file
,但是当我尝试这样做时,它说脚本已转换为新贵作业并使用“service mysql”命令。不幸的是,据我所知,该service
命令不支持该--init-file
选项。
有没有其他方法可以为 root 用户重置主机?
停止 MySQL:
service mysqld stop
Run Code Online (Sandbox Code Playgroud)
然后像这样启动MySQL
mysqld_safe --skip-grant-tables --skip-networking
Run Code Online (Sandbox Code Playgroud)
此时您应该能够以 root 身份连接到 mysql(从本地机器)。
归档时间: |
|
查看次数: |
2485 次 |
最近记录: |