mysql忘记密码时,使用mysqld_safe --skip-grant-tables 无效,报错,如下:
Server socket created on IP: '0.0.0.0'.
170205 19:02:18 [Note] Event Scheduler: Loaded 0 events
170205 19:02:18 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.37-log' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
170205 19:04:01 mysqld_safe A mysqld process already exists
170205 19:04:29 mysqld_safe A mysqld process already exists
170205 19:05:25 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
170205 19:05:25 [ERROR] Can't find messagefile '/usr/local/mysql/share/errmsg.sys'
170205 19:05:25 [Warning] Can't create test file /usr/local/mysql/data/iZ625fgu4w7Z.lower-test
170205 19:05:25 [Warning] Can't create test file /usr/local/mysql/data/iZ625fgu4w7Z.lower-test
/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql/data/' (Errcode: 2)
170205 19:05:25 [ERROR] Aborting
170205 19:05:25 [Note]
170205 19:05:25 mysqld_safe mysqld from pid file /usr/local/mysql/data/iZ625fgu4w7Z.pid ended
170205 19:08:53 mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
仔细分析错误日志后,提示无法从/usr/local/mysql/data启动数据库,但是我的数据库并没有安装在这个目录下面,感觉是 mysqld_safe里面的文件路径不对,打开后果然是,修改了数据的真实路径后,就可以使用mysqld_safe --skip-grant-tables 重置root密码了。
MySQL修改root密码的多种方法
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · docker定时任务Mysql脚本
- · docker安装mysql8注意事项
- · .NET8 Mysql SSL error
- · 定时备份docker中的mysql
- · docker-compose通过容器名连接mysql
- · unity3d mysql error: The given key was not present in the dictionary.
- · MySQL 批量修改数据表编码及字符集
- · Your database must use ‘READ-COMMITTED’ as the default isolation level.
- · MySQL-InnoDB存储引擎
- · 将数据从mysql迁移到clickhouse
- · mysql关于索引那些事儿
- · mysql大数据表加字段改名