You can make a mistake in order.
MySQL startup times wrong: starting MySQL ... error! The server quit without updating PID file (/opt/mysql-master/data/mysql.pid) Workaround:
1, may be/opt/mysql-master/data/data directory MySQL user does not have permissions (modify the data directory permissions)
Workaround: Give permission, execute "chown-r mysql.mysql/opt/mysql-master/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 the MySQL binary log directory to see if there is a mysql-binlog.index, and quickly delete it.
4. mysql will use the/ETC/MY.CNF configuration file when it is not specified at startup, please open this file to see if there is a specified data directory (DATADIR) under [mysqld].
WORKAROUND: Please set this line under [mysqld]: DataDir =/opt/mysql-master/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: Temporarily change to warning mode first: [[email protected] php]# Setenforce 0
Then open the/etc/sysconfig/selinux and change the selinux=enforcing to selinux=disabled
8, you can try to mysql.cnf default file open, troubleshooting is not a configuration file errors.
Common configuration errors are:
Check the configuration file/etc/my.cnf There is no innodb_buffer_pool_size this parameter
Innodb_buffer_pool_size: The main role is to cache the index of the InnoDB table, data, buffer when inserting data;
Default value: 128M;
Dedicated MySQL server sets the size of this value: System memory is 70%-80% best.
If your system has little memory, look at this parameter and set it to a smaller value.
Warm tip: Remember to turn on MySQL error log, convenient for your own troubleshooting.
VIM/ETC/MY.CNF You can edit according to your own my.cnf file.
[Mysql_safe]
Log-error =/data/mysql-master/logs/error.log
Mysql Startup failure Common error