安装mysql后,服务无法正常启动,报错如下:
解法方法:
1 以管理员身份运行命令提示符
2 用命令进行mysql安装目录的bin目录:
cd C:Program FilesMySQLMySQL Server 8.0in
3 用命令原来的服务删除:
mysqld --remove mysql
4 在mysql的根目录下,删除data目录
5 运行初始化mysql服务命令:
mysqld --initialize-insecure --user=mysql
6 运行更新配置文件命令:
mysqld --install mysql --defaults-file=C:Program FilesMySQLMySQL Server 8.0my.ini
7 安装mysql服务命令:
mysqld.exe –install
8 启动服务:
net start mysql
9 新服务会初始化密码空的root用户
mysql -u root –p