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. For example, mysqld_safeStartingmysqlddaemonwithdata saw a new student in the group yesterday asking the question that MySQL cannot be started. so I summarized several common cases. when the popular posts were published, 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.
Generally, when the mysqld process cannot be started, check the error log first regardless of any errors. (the log file is usually at $ datadir/xx. err file, or/var/log/message,/var/log/mysql/mysqld. according to the error log prompt, do not look at the surface prompt, for example, cannot find mysql. sock files.