MySQL: Starting MySQL….. ERROR! The server quit without updating PID file解决办法

Myth丶恋晨 2023-10-17 01:52 115阅读 0赞

1、问题:

  1. [root@iZ94ax97oadZ data]# /etc/init.d/mysql start
  2. Starting MySQL...The server quit without updating PID file (/db/mysql/data/iZ94ax97oadZ.pid). [FAILED]
  3. [root@iZ94ax97oadZ data]# /etc/init.d/mysql stop
  4. MySQL server PID file could not be found! [FAILED]

2、原因

没有初始化权限表

3、解决办法

#cd /usr/local/mysql(进入mysql安装目录)
#chown -R mysql.mysql .
#su - mysql
$cd server
$scripts/mysql_install_db

4、解决问题详细步骤:

  1. [root@iZ94ax97oadZ /]# cd /usr/local/mysql
  2. [root@iZ94ax97oadZ mysql]# chown -R mysql.mysql .
  3. [root@iZ94ax97oadZ mysql]# su - mysql
  4. [mysql@iZ94ax97oadZ ~]$ cd /usr/local/mysql
  5. [mysql@iZ94ax97oadZ mysql]$ scripts/mysql_install_db
  6. Installing MySQL system tables...2016-06-16 21:43:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  7. OK
  8. Filling help tables...2016-06-16 21:43:35 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  9. OK
  10. To start mysqld at boot time you have to copy
  11. support-files/mysql.server to the right place for your system
  12. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  13. To do so, start the server, then issue the following commands:
  14. ./bin/mysqladmin -u root password 'new-password'
  15. ./bin/mysqladmin -u root -h iZ94ax97oadZ password 'new-password'
  16. Alternatively you can run:
  17. ./bin/mysql_secure_installation
  18. which will also give you the option of removing the test
  19. databases and anonymous user created by default. This is
  20. strongly recommended for production servers.
  21. See the manual for more instructions.
  22. You can start the MySQL daemon with:
  23. cd . ; ./bin/mysqld_safe &
  24. You can test the MySQL daemon with mysql-test-run.pl
  25. cd mysql-test ; perl mysql-test-run.pl
  26. Please report any problems at http://bugs.mysql.com/
  27. The latest information about MySQL is available on the web at
  28. http://www.mysql.com
  29. Support MySQL by buying support/licenses at http://shop.mysql.com
  30. WARNING: Found existing config file ./my.cnf on the system.
  31. Because this file might be in use, it was not replaced,
  32. but was used in bootstrap (unless you used --defaults-file)
  33. and when you later start the server.
  34. The new default config file was created as ./my-new.cnf,
  35. please compare it with your file and take the changes you need.
  36. WARNING: Default config file /etc/my.cnf exists on the system
  37. This file will be read by default by the MySQL server
  38. If you do not want to use this, either remove it, or use the
  39. --defaults-file argument to mysqld_safe when starting the server
  40. [mysql@iZ94ax97oadZ mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql &
  41. [1] 26320
  42. [mysql@iZ94ax97oadZ mysql]$ 160616 21:43:58 mysqld_safe Logging to '/var/log/mysql/error.log'.
  43. 160616 21:43:58 mysqld_safe Starting mysqld daemon with databases from /db/mysql/data
  44. rm: cannot remove `/usr/local/mysql/mysql.sock': Is a directory
  45. 160616 21:44:00 mysqld_safe mysqld from pid file /db/mysql/data/iZ94ax97oadZ.pid ended
  46. [1]+ Done /usr/local/mysql/bin/mysqld_safe --user=mysql
  47. [mysql@iZ94ax97oadZ mysql]$
  48. [mysql@iZ94ax97oadZ mysql]$ /usr/local/mysql/bin/mysqld_safe --user=mysql &
  49. [1] 27160
  50. [mysql@iZ94ax97oadZ mysql]$ 160616 21:46:47 mysqld_safe Logging to '/var/log/mysql/error.log'.
  51. 160616 21:46:47 mysqld_safe Starting mysqld daemon with databases from /db/mysql/data
  52. [mysql@iZ94ax97oadZ mysql]$ /etc/init.d/mysql status
  53. MySQL running (27323) [ OK ]
  54. [mysql@iZ94ax97oadZ mysql]$ /etc/init.d/mysql start
  55. Starting MySQL [ OK ]
  56. [mysql@iZ94ax97oadZ mysql]$

发表评论

表情:
评论列表 (有 0 条评论,115人围观)

还没有评论,来说两句吧...

相关阅读