首页 > 解决方案 > CentOS7启动mysql失败

问题描述

标签: mysql

解决方案


You can fix this in few steps

  1. Execute this command to check if mysql user exists: cat /etc/passwd | grep mysql
  2. Validate if you have mysql in this file. It should look something like : mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/false
  3. If mysql user is not present please create that user like this : useradd -d /var/lib/mysql mysql
  4. If mysql user is present then make sure mysql user home path in /etc/passwd file actually exists and owned by mysql user (in the above case I mentioned /var/lib/mysql is home path and it has to be owned by mysql user)

Note: from what ever you have mentioned it looked like mysql user doesn't exist in your system. So it looks like creating the user with home path as /var/lib/mysql should solve the problem.


推荐阅读