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(mariadb)啟動失敗解決方法MySql
- sqlplus啟動失敗SQL
- tomcat 啟動失敗Tomcat
- docker啟動失敗Docker
- easyswoole啟動失敗
- sock鎖檔案導致的MySQL啟動失敗MySql
- Win7 Nginx啟動失敗 cmd命令失敗Win7Nginx
- Windows系統解決PhPStudy MySQL啟動失敗問題WindowsPHPMySql
- dota2啟動失敗 初始化vulkan失敗
- Linux使用Ambari啟動服務啟動失敗Linux
- Hadoop 啟動namenode節點失敗Hadoop
- Oracle RAC啟動失敗(DNS故障)OracleDNS
- 問題一:Kibaba 啟動失敗
- sqlserver服務啟動失敗-1067SQLServer
- dbsnmp啟動失敗解決方法
- mongodb啟動失敗問題解決MongoDB
- hbase啟動失敗問題解決
- sql server 重新啟動計算機失敗SQLServer計算機
- Oracle RAC常見啟動失敗故障分析Oracle
- SpringBoot專案引入Elasticsearch時啟動失敗Spring BootElasticsearch
- namenode單節點啟動成功後自動消失/格式化失敗/fsimage載入失敗
- mysqld啟動失敗時日誌檢視命令MySql
- 寶塔皮膚啟動失敗怎麼回事
- systemctl 命令設定開機自啟動失敗
- mac下啟動laradock失敗--Service ‘workspace‘ failed to buildMacAIUI
- win10啟動Apache伺服器失敗怎麼回事_win10系統Apache啟動失敗如何處理Win10Apache伺服器
- Mysql備份失敗案例(一)MySql
- vagrant啟動身份驗證失敗的解決方式
- Kali Linux 2020.1a版本msfconsole啟動失敗問題Linux
- yum安裝mongodb啟動失敗怎麼解決MongoDB
- RAC節點啟動失敗--ASM無法連線ASM
- 虛擬機器搭建rac ASM盤啟動失敗虛擬機ASM
- Oracle RAC啟動失敗-軟連結惹的禍Oracle
- 每次開機docker-desktop都啟動失敗了Docker
- Sublime 開啟命令框失敗
- 解決方案集錦——Tomcat伺服器啟動失敗Tomcat伺服器
- 【伺服器】伺服器的服務啟動失敗伺服器
- ORACLE ADG 最大可用模式下例項啟動失敗分析Oracle模式