Yesterday, I saw a new student in the Group still asking questions about MySQL startup failure. So I summarized several common cases, so I had the right to popularize the post and the old bird flew over. Problem 1: The Directory and file permission settings are incorrect. The $ datadir directory of MySQL and its subordinate directories and File Permission attributes are incorrectly set. As a result, MySQL cannot read and write files normally and cannot start. Error Message
Yesterday, I saw a new student in the Group still asking questions about MySQL startup failure. So I summarized several common cases, so I had the right to popularize the post and the old bird flew over. Problem 1: The Directory and file permission settings are incorrect. The $ datadir directory of MySQL and its subordinate directories and File Permission attributes are incorrectly set. As a result, MySQL cannot read and write files normally and cannot start. Error Message
Yesterday, I saw a new student in the Group still asking questions about MySQL startup failure. So I summarized several common cases, so I had the right to popularize the post and the old bird flew over.
Problem 1: Incorrect directory and file permission settings
The $ datadir directory of MySQL and its subordinate directories and File Permission attributes are incorrectly set. As a result, MySQL cannot read and write files normally and cannot start.
The error message is as follows:
mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql/data/imysql.local.err: Permission denied
Question 2: port conflict
If another mysqld instance is started and occupies the same port, You need to modify the port option.
The error message is as follows:
[ERROR] Can't start server: Bind on TCP/IP port: Address already in use[ERROR] Do you already have another mysqld server running on port: 3306 ?[ERROR] Aborting
Problem 3: the innodb configuration is incorrect.
The datafile and log file Settings in innodb are incorrect, causing startup failure. Especially when the default parameter is used for the first time, and then the innodb parameter is modified by referring to some optimization guidelines, the different size will be displayed, for example:
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytesInnoDB: than specified in the .cnf file 0 134217728 bytes![ERROR] Plugin ‘InnoDB’ init function returned error.[ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
Problem 4: The mysql system library is not initialized.
After MySQL is installed, you must run mysql_install_db to initialize the mysql system library.
This time, we will list the above several common problems and add them again.
In general, when the mysqld process cannot be started, check the Error Log First regardless of any errors. Locate the cause based on the error log prompt. Do not simply look at the surface prompt, for example, mysql cannot be found. sock files.
Technical problems :?
MySQL FAQ
Original article address: [MySQL FAQ] series-several common cases of failure to start MySQL. Thank you for sharing with me.