MySQL startup times wrong: starting MySQL ... error! The server quit without updating PID file (/opt/mysql/data/mysql.pid) Workaround:
http://blog.51cto.com/732233048/1636409
1, may be/opt/mysql/data/data directory MySQL user does not have permissions (modify the data directory permissions)
Workaround: Give permission, execute "chown-r mysql.mysql/opt/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 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/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
Additional:
Experience:
One more reason may be:
Check the configuration file/usr/local/mysql/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.
Summarize:
Add error log parameters in configuration file/etc/my.cnf, all issues resolved
12 |
[mysqld_safe] log -error = /data/mysql/logs/error. log |
To view log information when an error is started:
12345678910111213141516171819202122232425262728 |
#tail -f /data/mysql/logs/error.log
160721 06:12:07 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data
2016-07-21 06:12:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is
deprecated
. Please use --explicit_defaults_for_timestamp server option (see documentation
for
more details).
2016-07-21 06:12:10 0 [Note] /opt/mysql/bin/mysqld (mysqld 5.6.27-
log
) starting as process 2290 ...
2016-07-21 06:12:10 2290 [Note] Plugin
‘FEDERATED‘ is disabled.
2016-07-21 06:12:10 2290 [Warning] The option innodb (skip-innodb) is
deprecated
and will be removed in a future release
2016-07-21 06:12:10 2290 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-07-21 06:12:10 2290 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-21 06:12:10 2290 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-21 06:12:10 2290 [Note] InnoDB: Memory barrier is not used
2016-07-21 06:12:10 2290 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-21 06:12:10 2290 [Note] InnoDB: Using CPU crc32 instructions
2016-07-21 06:12:10 2290 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-07-21 06:12:10 2290 [Note] InnoDB: Completed initialization of buffer pool
2016-07-21 06:12:10 2290 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-21 06:12:11 2290 [Note] InnoDB: 128 rollback segment(s) are active.
2016-07-21 06:12:11 2290 [Note] InnoDB: Waiting
for
purge to start
2016-07-21 06:12:11 2290 [Note] InnoDB: 5.6.27 started;
log
sequence number 1625997
2016-07-21 06:12:11 2290 [ERROR] /opt/mysql/bin/mysqld: unknown option
‘--slave_parallel_workers=3‘
2016-07-21 06:12:11 2290 [ERROR] Aborting
2016-07-21 06:12:11 2290 [Note] Binlog end
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘partition‘
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘INNODB_SYS_DATAFILES‘
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘INNODB_SYS_TABLESPACES‘
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘INNODB_SYS_FOREIGN_COLS‘
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘INNODB_SYS_FOREIGN‘
2016-07-21 06:12:11 2290 [Note] Shutting down plugin
‘INNODB_SYS_FIELDS‘
|
Discovery Log Output
12 |
2016-07-21 06:12:11 2290 [ERROR] /opt/mysql/bin/mysqld: unknown option ‘--slave_parallel_workers=3‘ 2016-07-21 06:12:11 2290 [ERROR] Aborting |
This error parameter is definitely added to the config file, which can be removed.
New Add Error:
Starting mysql.171019 10:11:54 Mysqld_safe error:log-error set to '/data/tools/mysql/logs/error.log ', however file don ' t Exists. Create writable for user ' MySQL '.
This is a bug in MySQL new version: 5.6.35,5.6.36
Reference: https://bugs.mysql.com/bug.php?id=84427
Solve:
To create a log file manually:
Touch/data/tools/mysql/logs/error.log
Chown MySQL. /data/tools/mysql/logs/error.log
/etc/init.d/mysqld start
MySQL boot error: starting mysql ... error! The server quit without updating PID file