最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

MySQL下常見的啟動失敗與備份失敗問題的解決教程

 更新時間:2015年11月18日 12:16:07   作者:z永  
這篇文章主要介紹了MySQL下常見的啟動失敗與備份失敗問題的解決教程,示例環(huán)境基于Linux系統(tǒng),需要的朋友可以參考下

啟動失敗
重啟服務(wù)器后-->重啟應(yīng)用服務(wù)(Confluence)-->報錯,數(shù)據(jù)庫連接失?。╩ysql設(shè)置了開機自啟動)-->查看mysql數(shù)據(jù)庫狀態(tài):

[root@fisheye ~]# ps -ef | grep mysql
root   25555 21974 0 11:28 pts/0  00:00:00 grep mysql

啟動mysql服務(wù)器

[root@fisheye data]# service mysql start
MySQL server PID file could not be found![失敗]
Starting MySQL.............. ERROR! The server quit without updating PID file (/mydata/data/fisheye..pid).[失敗]

查看錯誤日志:

[root@fisheye data]# tail -100 fisheye.err
InnoDB: Last MySQL binlog file position 0 337403929, file name ./mysql-bin.000016
141013 1:13:28 InnoDB: Waiting for the background threads to start
141013 1:13:29 InnoDB: 5.5.33 started; log sequence number 1006647152
17:13:29 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
di141013 01:13:29 mysqld_safe mysqld from pid file /mydata/data/fisheye.pid ended

未發(fā)現(xiàn)明顯性錯誤提示,所以手動創(chuàng)建一個pid文件試試

[root@fisheye data]# touch /mydata/data/fisheye.pi

再進行重啟服務(wù):

[root@fisheye data]# service mysql restart
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

突然想到之前看過此類報錯的文章,記得有可能是磁盤空間不足導(dǎo)致的mysql無法啟動。

[root@fisheye data]# df -h

(文件系統(tǒng)              容量  已用 可用 已用% 掛載點)

/dev/sda1       9.5G 9.5G 0 100% /
/dev/sda4       5.5G 1.3G 4.0G 24% /mnt/backup
/dev/mapper/IhuilianVG-IhuilianLV00
            22G 4.2G  17G 20% /var/www/app
tmpfs         1.3G   0 1.3G  0% /dev/shm

果然如此,下面羅列一些類似問題(無法啟動)的解決思路:
1.可能是datadir目錄存在的分區(qū)滿了(df -h )
       解決方法:打開配置文件/etc/my.cnf,在[mysqld]節(jié)下重新指定數(shù)據(jù)目錄(datadir),并將原來的數(shù)據(jù)目錄遷移到重新制定的數(shù)據(jù)目錄處
       關(guān)于遷移:(1)、cp或者tar的時候一定要把權(quán)限給帶上,但是為防止意外建議再授權(quán)一次;(2)、數(shù)據(jù)比較大時一定要先壓縮再遷移,保證完整性,特別是scp到其他機器時可能會超時所以一定要壓縮(tar.gz);(3)、若是移動至另外的服務(wù)器一定要保證mysql版本一致。

2.可能是/mydata/data/fisheye.pid文件沒有寫的權(quán)限
      解決方法 :給予權(quán)限,執(zhí)行 “chown -R mysql:mysql /mydata/data/”  然后重新啟動mysqld!

3.可能進程里已經(jīng)存在mysql進程
      解決方法:用命令“ps -ef|grep mysqld”查看是否有mysqld進程,如果有使用“kill -9  進程號”殺死,然后重新啟動mysqld!

4.可能是第二次在機器上安裝mysql,有殘余數(shù)據(jù)影響了服務(wù)的啟動。
       解決方法:去mysql的數(shù)據(jù)目錄/data看看,如果存在mysql-bin.index,就趕快把它刪除掉吧,它就是罪魁禍首了。

5.skip-federated字段問題(報錯信息:[ERROR] /mydata/data/mysql/libexec/mysqld: unknown option '--skip-federated')
       解決方法:檢查一下/etc/my.cnf文件中有沒有沒被注釋掉的skip-federated字段,如果有就立即注釋掉吧。

6.selinux惹的禍,如果是centos系統(tǒng),默認會開啟selinux
       解決方法:關(guān)閉它,打開/etc/selinux/config,把SELINUX=enforcing改為SELINUX=disabled后存盤退出重啟機器試試。

備份失敗
說明
執(zhí)行 mysqldump 時出現(xiàn)找不到某一個 tables 并且中斷執(zhí)行?及鎖表后延伸出現(xiàn)的問題記錄!
問題及方案如下
Error Meaage: 執(zhí)行mysqldump 時出現(xiàn)找不到某一個 tables 并且中斷執(zhí)行

[root@test100 data]# mysqldump fx > fx.sql
mysqldump: Got error: 1146: Table 'user_suggest_report' doesn't exist when using LOCK TABLES

考慮加上 --skip-lock-tables或者-R進行鎖表試試,也是不行,信息如下

[root@test100 data]#mysqldump --skip-lock-tables fx > fx.sql
Error: Couldn't read status information for table vote_results () mysqldump: Couldn't execute 'show create table `user_suggest_report`': Table 'fx.user_suggest_report' doesn't exist (1146)

登陸服務(wù)器查看是否存在此表

 [root@test100 data]#mysql -h127.0.0.1 -D fx
 mysql> show tables;      #查看所有的表 --> 發(fā)現(xiàn)是表存在的
+--------------------------------+
| Tables_in_fx          |
+--------------------------------+
| user_suggest_report      |
+--------------------------------+
80 rows in set (0.00 sec)

刪除此表

mysql> drop table user_suggest_report;      #既然是存在的,但是系統(tǒng)卻認定不存在說明存在問題,索性想刪除試試
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user_suggest_report' at line 1

進入mysql存儲目錄下將其數(shù)據(jù)表移動或刪除

[root@test100 data]# cat /etc/my.cnf | grep datadir
datadir=/var/lib/mysql
[root@test100 data]# cd /var/lib/mysql/fx/
[root@test100 fx]# mv user_suggest_report.frm /data

重啟mysql服務(wù)器

[root@test100 fx]# service mysqld restart

重新備份操作

[root@test100 data]# mysqldump fx > fx.150109.sql  #操作成功

相關(guān)文章

最新評論

红桥区| 旺苍县| 遂溪县| 河北区| 长春市| 杨浦区| 通江县| 清新县| 西充县| 广州市| 徐州市| 墨竹工卡县| 贡觉县| 资兴市| 攀枝花市| 雅江县| 许昌市| 奉化市| 扬州市| 伊宁市| 衡南县| 澎湖县| 岳普湖县| 枣强县| 桐柏县| 延长县| 土默特右旗| 略阳县| 浦北县| 化隆| 通海县| 金山区| 茌平县| 灵石县| 富阳市| 来凤县| 巴林右旗| 怀宁县| 沾益县| 雷波县| 海南省|