Web page today to submit content to the database, found that the error, has not been submitted, the number of the next reason to find the data can not be written in! The first reaction, restart the MySQL database, has been executing, can not stop and start not, the intuition tells me that the disk is full!
With df command Check, sure enough disk full, because at that time the partition system default, do not know why not automatic expansion! In the future to deal with this problem! :
Copy CodeThe code is as follows: [[email protected] ~]# DF
File system 1k-block already used% mount point available
/dev/mapper/vg_snsgou-lv_root
51606140 47734848 1249852 100%/
Tmpfs 1953396 1953308 1%/DEV/SHM
/DEV/SDA1 495844 37062 433182 8%/boot
/dev/mapper/vg_snsgou-lv_home
229694676 191796 217835016 1%/Home
[Email protected] ~]#
After deleting some useless logs, restarting the database is an error.
Copy CodeThe code is as follows: [[email protected] mysql]# service MySQL restart
MySQL server PID file could not being found! Failed
Starting MySQL ... The server quit without updating PID file (/usr/local/mysql/data/snsgou.pid). Failed
Google, the problem may be caused by a variety of reasons, the best way is to check the error log first:
1, may be the/usr/local/mysql/data/mysql.pid file does not have the permission to write
Workaround: Give permission, execute "chown-r mysql:mysql/var/data" "Chmod-r 755/usr/local/mysql/data" and restart mysqld!
2. The MySQL process may already exist in the process
WORKAROUND: Use the command "Ps-ef|grep mysqld" to see if there is a mysqld process, kill with "kill-9 process number" and then restart mysqld!
3, may be the second time to install MySQL on the machine, there are residual data affect the start of the service.
Workaround: Go to MySQL data directory/data See, if there is mysql-bin.index, quickly delete it, it is the culprit. I am using the third method to solve!
4, MySQL will use the/ETC/MY.CNF configuration file when the configuration file is not specified at startup, please open this file to see if there is a specified data directory (DATADIR) under the [Mysqld] section.
WORKAROUND: Please set this line under [mysqld]: DataDir =/usr/local/mysql/data
5. skip-federated field Problem
Workaround: Check the/etc/my.cnf file for any skip-federated fields that have not been commented out, and if so, comment them out immediately.
6. Error log directory does not exist
Workaround: Use "Chown" "chmod" command to give MySQL owner and permissions
7, the disaster of SELinux, if it is a CentOS system, default will open SELinux
Workaround: Turn it off, open the/etc/selinux/config, change the selinux=enforcing to selinux=disabled, and then save the restart machine and try again.
MySQL hint: the server quit without updating PID file problem Solving method