Job for mysqld.service failed because the control process exited with error code. See “systemctl sta

问题描述
编译安装的Mysql 5.7
删除数据存放目录 data
无法使用 systemctl start mysql 再次启动

错误提示:
Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.

解决方法:
编译安装的要先进行初始化
例如我的编译安装目录是/usr/local/mysql
执行:

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/data

初始化后即可使用 systemctl start mysql 进行管理
另外还需注意mysql的目录权限问题,要给予权限。

猜你喜欢

转载自blog.csdn.net/qq_26129413/article/details/111871480