加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_镇江站长网 (https://www.0511zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MySQL开启失败

发布时间:2022-06-28 05:28:32 所属栏目:MySql教程 来源:互联网
导读:MySQL启动失败: 一、错误日志: [mysql@host-172-24-115-217 ~]$ service mysql restart Shutting down MySQL.. SUCCESS! Starting MySQL..180426 13:36:03 mysqld_safe Logging to /usr/local/mysql/data/alert.log. 180426 13:36:03 mysqld_safe Starti
        MySQL启动失败:

  一、错误日志:
  [mysql@host-172-24-115-217 ~]$ service mysql restart
  Shutting down MySQL.. SUCCESS!
  Starting MySQL..180426 13:36:03 mysqld_safe Logging to '/usr/local/mysql/data/alert.log'.
  180426 13:36:03 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

  二、分析日志:
  (1)查看日志
  usr/local/mysql/data/alert.log
  发现:Version: '5.5.59-MariaDB'  socket: '/usr/local/mysql/data/mysql.sock'  port: 3306  MariaDB Server
  表示mysqld 启动完毕。
 
  (2)查看进程
  [mysql@host-172-24-115-217 fd]$ ps -ef | grep mysqld
  mysql    20633     1  0 13:36 pts/5    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysqlProcess.pid
  mysql    21736 20633  0 13:36 pts/5    00:00:02 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/alert.log --pid-file=/usr/local/mysql/data/mysqlProcess.pid --socket=/usr/local/mysql/data/mysql.sock --port=3306
  mysql    22436  7333  0 13:40 pts/3    00:00:00 grep mysqld
 
  分析:
  从日志和进程信息可以看出此mysqld服务正常。那为什么出现启动失败的现象。
 
  三、挖掘原因
  既然mysqld服务进程正常,那从其它机器是否可以登录。经过测试
  [mysql@host-172-24-115-218 ~]$ mysql -h272.24.115.217 -uroot -pmysql
  Welcome to the MariaDB monitor.  Commands end with ; or g.
  Your MariaDB connection id is 1
  Server version: 5.5.59-MariaDB MariaDB Server
 
  Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
  Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
 
  MariaDB [(none)]>
 
  经过验证,可以登录。
 
  四:结论
  从此可以推断
  mysql服务器的client配置错误,导致mysql进程读取配置导致异常
 
  检查/etc/my.cnf 发现如下:
  [client]
  #socket = /usr/local/mysql/data/mysql.sock
  default-character-set = gbk
  port = 3306
 
  缺少红色部分,注释后,再次重启一切正常。
 
  希望改进:
  希望mysql的启动过程相关的shell脚本也能添加相应的日志,协助分析问题。
 
  That is all.
  Good Luck!
 

(编辑:应用网_镇江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!