An error occurred while starting the mysql database.

Source: Internet
Author: User
After the server is restarted -- restart the Application Service (Confluence) -- an error is reported, indicating that the database connection fails (mysql is set to start automatically after startup) -- view the mysql database status: [root @ fisheye ~] # Ps-ef | grepmysqlroot ..

After the server is restarted -- restart the Application Service (Confluence) -- an error is reported, indicating that the database connection fails (mysql is set to start automatically after startup) -- view the mysql database status: [root @ fisheye ~] # Ps-ef | grepmysqlroot ..

After the server is restarted --> restart the Application Service (Confluence) --> An error is reported, indicating that the database connection fails (mysql is set to boot automatically) --> View the mysql database status:

[Root @ fisheye ~] # Ps-ef | grep mysqlroot 25555 21974 0 00:00:00 pts/0 grep mysql

Start the mysql server

[Root @ fisheye data] # service mysql startMySQL server PID file cocould not be found! [Failed] Starting MySQL ...... ERROR! The server quit without updating PID file (/mydata/data/fisheye... pid). [failed]

View error logs:

[Root @ fisheye data] # tail-100 fisheye. errInnoDB: Last MySQL binlog file position 0 337403929, file name. mysql-bin.000016141013 1:13:28 InnoDB: Waiting for the background threads to start141013 1:13:29 InnoDB: 5.5.33 started; log sequence number 100664715217: 13: 29 UTC-mysqld got signal 11; this cocould be because you hit a bug. it is also possible that this binaryor one of the libraries it was linked against is already upt, improperly built, or misconfigured. this error can also be caused by malfunctioning hardware. we will try our best to scrape up some info that will hopefully helpdi141013 01:13:29 mysqld_safe mysqld from pid file/mydata/data/fisheye. pid ended

No obvious error prompt is found, so try to manually create a pid File

[Root @ fisheye data] # touch/mydata/data/fisheye. pi

Restart the service again:

[Root @ fisheye data] # service mysql restartERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql. sock' (2)

I suddenly thought of the articles that I have read about this type of error. Remember that mysql cannot be started due to insufficient disk space.

[Root @ fisheye data] # df-H file system capacity used available % mount point/dev/sda1 9.5G 9.5G 0 100%/dev/sda4 5.5G 1.3G 4.0G 24%/mnt/backup/dev/mapper/IhuilianVG-IhuilianLV00 22G 4.2G 17G 20%/var/www/apptmpfs 1.3G 0 1.3G 0%/dev/shm

As a result, the following lists some solutions to similar problems (cannot be started:

1. It may be that the partitions in the datadir directory are full (df-h)

Solution: Open the configuration file/etc/my. cnf: Re-specify the data directory (datadir) under [mysqld], and migrate the original data directory to the newly created data directory.

About migration: (strong); (3) if you move to another server, ensure that the mysql version is consistent.


2. It may be that the/mydata/data/fisheye. pid file has no write permission.

Solution: grant permissions, execute "chown-R mysql: mysql/mydata/data/", and restart mysqld!


3. the mysql process may already exist in the process.

Solution: Run "ps-ef | grep mysqld" to check whether the mysqld process exists. If the "kill-9 process number" is used to kill the process and restart mysqld!


4. mysql may be installed on the machine for the second time. The Service Startup may be affected due to residual data.

Solution: Go to the mysql data DIRECTORY/data to see, if there is a mysql-bin.index, just remove it, it is the culprit.


5. skip-federated field problem (ERROR message: [ERROR]/mydata/data/mysql/libexec/mysqld: unknown option '-- skip-federated ')

Solution: Check whether the skip-federated field has been commented out in the/etc/my. cnf file. If so, comment out the field immediately.


6. selinux. If it is a centos system, selinux is enabled by default.

Solution: Close it, open/etc/selinux/config, change SELINUX = enforcing to SELINUX = disabled, and then save the disk and restart the machine.


This article is from the "starting point dream" blog. Please keep this source

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.