Error when starting MySQL on Linux: Status: "Server shutdown complete" Error:13 (insufficient permissions)

Status: "Server shutdown complete" Error:13 (insufficient permissions)

When I installed and started MySQL in the Galaxy Kirin V10 system, an error occurred: "Server shutdown complete" Error: 13 (insufficient permissions). I have not encountered this in other systems.

Problem background

When trying to start the MySQL server on the localized system Galaxy Kirin V10, you may receive the following error message:

Status: "Server shutdown complete"
Error: 13 (权限不够)

This usually indicates that the MySQL server encountered a permissions issue when trying to start, preventing it from starting successfully.

possible reason

  1. Insufficient file permissions: MySQL needs to access and write some files and directories. If the user running the MySQL process does not have sufficient permissions, it will cause the startup to fail.

  2. Data directory owner error: The data directory and its contents may belong to the incorrect user or group, and the MySQL server cannot read or write these files.

solution

1. Check file and directory permissions

Make sure the permissions on the MySQL data directory and its subdirectories are correct. You can change permissions using the following command:

sudo chown -R mysql:mysql /var/lib/mysql
sudo chmod -R 755 /var/lib/mysql

This will give ownership of the MySQL data directory to the MySQL user and set the appropriate permissions.

2. Check MySQL logs

View the MySQL error log for more details so you can find the specific cause of the startup error. Typically, the MySQL error log is located in the hostname.err file in the MySQL data directory. You can find the file using the following command:

sudo find / -name '*hostname.err'

Then, view the contents of the file:

cat /path/to/mysql/hostname.err

By checking the error logs, you may find more details about the permissions issue and be better able to troubleshoot the issue.

Guess you like

Origin blog.csdn.net/weixin_45626288/article/details/134929836