代码改变世界

解压版mysql 错误-mysql启动失败

2018-06-08 15:36  如是我所闻  阅读(5511)  评论(0编辑  收藏  举报

参考博客:https://blog.csdn.net/kerecs/article/details/51498754

    https://blog.csdn.net/zwj1030711290/article/details/80039780

1.在mysql安装目录下删除data目录

 

2.my.ini目录下的路径由\改为\\

basedir = D:\\studySoft\\mysql-8.0.11
datadir = D:\\studySoft\\mysql-8.0.11\\data

3.管理员身份模式进入mysql下的bin目录

 

4.移除已注册服务:

mysqld remove

 

5.初始化:mysqld --initialize --console

2018-04-20T02:35:01.507037Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-04-20T02:35:01.507640Z 0 [System] [MY-013169] [Server] D:\Program\MySQL8\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 11064
2018-04-20T02:35:01.508173Z 0 [ERROR] [MY-010340] [Server] Error message file 'D:\Program\MySQL\share\english\errmsg.sys' had only 1090 error messages, but it should contain at least 4512 error messages. Check that the above file is the right version for this program!
2018-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: APWCY5ws&hjQ
2018-04-20T02:35:07.017280Z 0 [System] [MY-013170] [Server] D:\Program\MySQL8\bin\mysqld.exe (mysqld 8.0.11) initializing of server has completed

标红为生成的root密码,记录下来。

 

6.注册服务:

mysqld -install

 

7.更改密码:

  输入 mysql -uroot -p命令后,输入之前记录的root密码

 

8.更改密码命令

MySQL8.0.4以前,执行

SET PASSWORD=PASSWORD('[修改的密码]');
mysql8.0.4以后
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '修改的密码';

 

9.启动服务:net start mysql