一、錯(cuò)誤日志:
[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
發(fā)現(xiàn):Version: '5.5.59-MariaDB' socket: '/usr/local/mysql/data/mysql.sock' port: 3306 MariaDB Server
表示mysqld 啟動(dòng)完畢。
(2)查看進(jìn)程
[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
分析:
從日志和進(jìn)程信息可以看出此mysqld服務(wù)正常。那為什么出現(xiàn)啟動(dòng)失敗的現(xiàn)象。
三、挖掘原因
既然mysqld服務(wù)進(jìn)程正常,那從其它機(jī)器是否可以登錄。經(jīng)過(guò)測(cè)試
[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)]>
經(jīng)過(guò)驗(yàn)證,可以登錄。
四:結(jié)論
從此可以推斷
mysql
服務(wù)器的client配置錯(cuò)誤,導(dǎo)致mysql進(jìn)程讀取配置導(dǎo)致異常
檢查/etc/my.cnf 發(fā)現(xiàn)如下:
[client]
#socket = /usr/local/mysql/data/mysql.sock
default-character-set = gbk
port = 3306
缺少紅色部分,注釋后,再次重啟一切正常。
希望改進(jìn):
希望mysql的啟動(dòng)過(guò)程相關(guān)的shell腳本也能添加相應(yīng)的日志,協(xié)助分析問(wèn)題。
That is all.
Good Luck!
網(wǎng)站名稱(chēng):MySQL啟動(dòng)失敗
網(wǎng)頁(yè)地址:http://aaarwkj.com/article32/igeopc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT、網(wǎng)站收錄、網(wǎng)站策劃、建站公司、標(biāo)簽優(yōu)化、企業(yè)建站
廣告
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源:
創(chuàng)新互聯(lián)