CentOS 利用Yum安装mysql后无法启动(MySQL Daemon failed to start.)

服务器   发布日期:2025年05月22日   浏览次数:163

安装mysql-server

  1. [root@iZwz9cl4i8oy1reej7o8pmZ ~]# yum install -y mysql-server

进入/etc执行mysql_install_db 

  1. [root@iZwz9cl4i8oy1reej7o8pmZ ~]# /etc/init.d/mysqld start
  2. MySQL Daemon failed to start.
  3. Starting mysqld: [FAILED]
  4. [root@iZwz9cl4i8oy1reej7o8pmZ ~]#

执行

  1. [root@iZwz9cl4i8oy1reej7o8pmZ ~]# cd /etc/
  2. [root@iZwz9cl4i8oy1reej7o8pmZ etc]# mysql_install_db
  3. Installing MySQL system tables...
  4. OK
  5. Filling help tables...
  6. OK
  7. To start mysqld at boot time you have to copy
  8. support-files/mysql.server to the right place for your system
  9. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  10. To do so, start the server, then issue the following commands:
  11. /usr/bin/mysqladmin -u root password 'new-password'
  12. /usr/bin/mysqladmin -u root -h iZwz9cl4i8oy1reej7o8pmZ password 'new-password'
  13. Alternatively you can run:
  14. /usr/bin/mysql_secure_installation
  15. which will also give you the option of removing the test
  16. databases and anonymous user created by default. This is
  17. strongly recommended for production servers.
  18. See the manual for more instructions.
  19. You can start the MySQL daemon with:
  20. cd /usr ; /usr/bin/mysqld_safe &
  21. You can test the MySQL daemon with mysql-test-run.pl
  22. cd /usr/mysql-test ; perl mysql-test-run.pl
  23. Please report any problems with the /usr/bin/mysqlbug script!
  24. [root@iZwz9cl4i8oy1reej7o8pmZ etc]#

再次测试

  1. [root@iZwz9cl4i8oy1reej7o8pmZ ~]# mysql
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is
  4. Server version: 5.1. Source distribution
  5. Copyright (c) , , Oracle and/or its affiliates. All rights reserved.
  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.
  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  10. mysql>

 

以上就是CentOS 利用Yum安装mysql后无法启动(MySQL Daemon failed to start.)的详细内容,更多关于CentOS 利用Yum安装mysql后无法启动(MySQL Daemon failed to start.)的资料请关注九品源码其它相关文章!