In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you the reasons why mysql can not start to create pid, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The reason why the mysql startup cannot create a pid: 1. The port is occupied; 2. The permission of the directory mysql that generated the pid file is insufficient; 3. The my.cnf configuration file corresponding to the mysql is incorrect; 4. There is a problem with the startup script of mysql; 5. The mysql has residual data that affects the startup of the service.
The operating environment of this tutorial: windows7 system, mysql8.0.22 version, DELL G3 computer.
The reason why mysql startup cannot create a pid:
Problem 1: the port is occupied
If the port of the mysql you started is already occupied by other services, change the port number in the corresponding my.cnf to another port, and then restart mysql.
[mysqld] port=3307
If there is already a process for the mysql before restarting the mysql, it is recommended that the kill drop and restart.
Problem 2: insufficient permissions for mysql, the directory that generates pid files
Find the specified mysql data storage directory and authorize
Chown-R mysql.mysql / data/mysql
If it is authorized, it still cannot be started. You can touch a pid file named by the host name yourself, and then start it.
Cd / data/mysql touch node1.pid
Problem 3: the my.cnf profile corresponding to the mysql is incorrect.
Check whether the parameters such as port,datadir,basedir,socket in my.cnf are configured correctly, and whether the configured directory mysql has permissions
Problem 4: there is a problem with the startup script of mysql
When you are not sure whether the parameters in the startup script or mysql.server configuration file are normal, start it in mysqld_safe mode to see if it can be started.
(first cd to the installation root of mysql)
. / mysqld_safe-defaults-file=/etc/mysql_3306/my.cnf-- user=mysql or./mysqld_safe-- defaults-file=/etc/mysql/3306/my.cnf-- basedir=/Apk/install/mysql-- datadir = / mysql/data/-- pid-file=/mysql/data/mysql.pid-- socket=/mysql/data/mysql.sock-- port=3306
If you can start it, you need to check the parameters in the mysql startup script or mysql.server configuration file and modify them.
Focus on the following two parameters
Basedirdatadir
Question 5: there is residual data in the mysql that affects the startup of the service
Delete the data storage directory in mysql, and then restart it.
Cd / data/mysql/rm-r * index/etc/init.d/mysql start
If it still fails to start, go to mysql's data storage directory to delete it, and then start it.
(if the database is not newly installed and the data is still in use, it is not recommended to delete files that begin with ib. If you want to use backup to restore the database after deletion)
Cd / data/mysql/rm-r * indexrm-r ib*
Remarks
If you delete all the files in the mysql data storage directory, you should reinitialize them. After initialization, start.
For example:
/ Apk/install/mysql/mysql-5.5.32/script/mysql_install_db-- user=mysql-- basedir=/Apk/install/mysql/mysql-5.5.32-- datadir=/Apk/data/mysql_3306/data-- pid-file=/Apk/data/mysql_3306/data/mysql.pid-- socket=/tmp/mysql_3306.sock-- port=3306 is all the contents of the article "Why mysql can't start up and create pid". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.