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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. ERROR!
二、分析日誌:
(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 -h172.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!
[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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. ERROR!
二、分析日誌:
(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 -h172.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!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29497382/viewspace-2153389/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL Study之–Mysql啟動失敗“mysql.host”薦MySql
- mysql(mariadb)啟動失敗解決方法MySql
- docker啟動失敗Docker
- tomcat 啟動失敗Tomcat
- Win7 Nginx啟動失敗 cmd命令失敗Win7Nginx
- sock鎖檔案導致的MySQL啟動失敗MySql
- sqlplus啟動失敗SQL
- linux smartd啟動失敗Linux
- dota2啟動失敗 初始化vulkan失敗
- Oracle RAC啟動失敗(DNS故障)OracleDNS
- dbsnmp啟動失敗解決方法
- 監聽啟動失敗解決
- init.cssd程式啟動失敗CSS
- informix資料庫啟動失敗ORM資料庫
- Windows系統解決PhPStudy MySQL啟動失敗問題WindowsPHPMySql
- CentOS 7下MySQL服務啟動失敗的解決思路CentOSMySql
- Linux使用Ambari啟動服務啟動失敗Linux
- Hadoop 啟動namenode節點失敗Hadoop
- hbase啟動失敗問題解決
- oracle 10g em啟動失敗Oracle 10g
- mongodb啟動失敗問題解決MongoDB
- Oracle RAC常見啟動失敗故障分析Oracle
- sqlserver服務啟動失敗-1067SQLServer
- sql server 重新啟動計算機失敗SQLServer計算機
- OracleDBConsole啟動失敗處理Oracle
- oracle 10g em啟動失敗 續Oracle 10g
- 寶塔皮膚啟動失敗怎麼回事
- namenode單節點啟動成功後自動消失/格式化失敗/fsimage載入失敗
- systemctl 命令設定開機自啟動失敗
- mysqld啟動失敗時日誌檢視命令MySql
- 二所SDD席位Xrec程式啟動失敗案例C程式
- android 模擬器啟動失敗應對Android
- MQ服務啟動失敗的解決方法MQ
- 使用Huge Pages後資料庫啟動失敗資料庫
- win10啟動Apache伺服器失敗怎麼回事_win10系統Apache啟動失敗如何處理Win10Apache伺服器
- 【MySQL】AppArmor導致datadir遷移無法啟動&初始化失敗MySqlAPP
- vagrant啟動身份驗證失敗的解決方式
- yum安裝mongodb啟動失敗怎麼解決MongoDB