Ubuntu MySQL Error: 'mysql-bin.index' File Not Found (Permission Denied)
This error message indicates that the MySQL server is unable to find the 'mysql-bin.index' file in the specified location due to insufficient permissions.
To resolve this issue, you can follow these steps:
- 
Check the ownership and permissions of the '/data/binlog' directory. Make sure that the MySQL user (usually 'mysql') has the necessary permissions to access and modify files in that directory.
 
ls -ld /data/binlog
The output should show the owner and group of the directory, as well as the directory permissions. If the owner is not 'mysql' or if the permissions are too restrictive, you need to change them.
2. **Change the ownership and permissions of the '/data/binlog' directory if necessary.** You can use the 'chown' and 'chmod' commands to accomplish this.
sudo chown mysql:mysql /data/binlog sudo chmod 755 /data/binlog
The first command changes the ownership of the directory to the 'mysql' user and group, while the second command sets the permissions to allow read, write, and execute for the owner, and read and execute for others.
3. **Restart the MySQL service to apply the changes.**
sudo service mysql restart
Once the MySQL service restarts, it should be able to find the 'mysql-bin.index' file without any permission denied errors.
原文地址: https://www.cveoy.top/t/topic/qzWd 著作权归作者所有。请勿转载和采集!