MySQL startup times wrong: starting MySQL ... error! Workaround for the server quit without updating PID file (/opt/mysql/data/mysql.pid)

Source: Internet
Author: User
Tags deprecated

The likelihood of problems occurring

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]www 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.

Summary:

Add error log parameters in configuration file/etc/my.cnf, all issues resolved

[Mysqld_safe]log-error =/data/mysql/logs/error.log

To view log information when an error is started:

#tail-F/data/mysql/logs/error.log 160721 06:12:07 Mysqld_safe starting mysqld daemon with databases From/data/mysql/dat a2016-07-21 06:12:10 0 [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-07-21 06:12:10 0 [not E]/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 would be removed in a future release2016-07-21 06:12:10 2290 [Note] innodb:using Atomics to ref Count buffer pool pages2016-07-21 06:12:10 2290 [Note] innodb:the InnoDB memory heap is disabled2016-07-21 06:12:10 2290 [Note] Innodb:mutexes and Rw_locks use GCC atomic builtins2016-07-21 06:12:10 2290 [Note] innodb:memory barrier are not used2016 -07-21 06:12:10 2290 [note] innodb:compressed tables use zlib 1.2.32016-07-21 06:12:10 2290 [note] inNodb:using CPU crc32 instructions2016-07-21 06:12:10 2290 [Note] innodb:initializing buffer pool, size = 128.0m2016-07-2 1 06:12:10 2290 [note] innodb:completed initialization of buffer pool2016-07-21 06:12:10 2290 [note] Innodb:highest supp orted file format is barracuda.2016-07-21 06:12:11 2290 [Note] innodb:128 rollback segment (s) was active.2016-07-21 06:12 : 2290 [note] innodb:waiting for purge to start2016-07-21 06:12:11 2290 [note] innodb:5.6.27 started; Log sequence number 16259972016-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] aborting2016-07-21 06:12:11 2290 [Note] Binlog end2016-07-21 06:12:11 2290 [not E] Shutting plugin ' partition ' 2016-07-21 06:12:11 2290 [Note] shutting down plugin ' innodb_sys_datafiles ' 2016-07-21 0 6:12:11 2290 [note] shutting down plugin ' innodb_sys_tablespaces ' 2016-07-21 06:12:11 2290 [note] shutting down plugin ' INN Odb_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

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.logchown MySQL. /data/tools/mysql/logs/error.log/etc/init.d/mysqld start

Transferred from http://732233048.blog.51cto.com/9323668/1636409, the copyright belongs to the author.

MySQL startup times wrong: starting MySQL ... error! Workaround for the server quit without updating PID file (/opt/mysql/data/mysql.pid)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.