今天刚接手新项目的服务器,不知道以前谁搭建的
因为要备份数据库,但是发现空间不足
/根目录满的,然后我移动软件和文件
造成 mysql启动不了
|
1
2
|
[email protected] ~]# /data/mysql/bin/mysqldump --databases star -uroot -p123456 > /home/star.sqlmysqldump: Couldn't execute 'show fields from `c_help`': Got error 28 from storage engine (1030)
|
|
1
2
3
4
5
6
|
[[email protected] ~]# df -lhFilesystem Size Used Avail Use% Mounted on/dev/sda3 2.0G 2.0G 0 100% /
/dev/sda5 246G 29G 205G 13% /data
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 7.9G 0 7.9G 0% /dev/shm
|
|
1
2
3
4
5
6
7
8
|
发现空间不足,也不知道谁搭建的服务器,坑死我了[email protected] share]# mv * /data/ceshi/share/[[email protected] share]# df -ThFilesystem Type Size Used Avail Use% Mounted on/dev/sda3 ext3 2.0G 1.5G 382M 80% /
/dev/sda5 ext3 246G 24G 209G 11% /data
/dev/sda1 ext3 99M 12M 82M 13% /boot
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
|
mysql.sock不在了
|
1
2
3
4
5
|
[[email protected] tmp]# locate mysql.sock[[email protected] tmp]# /data/mysql/bin/ data/ include/ lib/ libexec/ log/ mysql-test/ share/ sql-bench/
[[email protected] tmp]# /data/mysql/bin/mysql startERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
|
没有进程
|
1
2
|
[[email protected] tmp]# killall mysqld
mysqld: no process killed |
|
1
2
3
|
[[email protected] tmp]# ps -aux | grep mysqldWarning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 22246 0.0 0.0 61196 720 pts/2 S+ 13:14 0:00 grep mysqld
|
|
1
2
3
|
[[email protected] tmp]# more /etc/my.cnf|grep socksocket=/var/lib/mysql/mysql.sock
|
太奇葩了这问题
查看报错日志
|
1
2
3
4
5
6
7
8
9
10
11
|
140104 3:00:02 [ERROR] /data/mysql/libexec/mysqld: Sort aborted
140105 3:00:02 [ERROR] /data/mysql/libexec/mysqld: Sort aborted
140106 3:00:01 [ERROR] /data/mysql/libexec/mysqld: Sort aborted
140107 3:00:01 [ERROR] /data/mysql/libexec/mysqld: Sort aborted
140324 12:09:26 [Note] /data/mysql/libexec/mysqld: Normal shutdown
140324 12:09:26 [Note] Slave I/O thread killed while reading event
140324 12:09:26 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000013', position 54495054
140324 12:09:26 [Note] Error reading relay log event: slave SQL thread was killed
140324 12:09:44 InnoDB: Starting shutdown...
140324 12:09:46 InnoDB: Shutdown completed; log sequence number 0 1573472989
140324 12:09:46 [Note] /data/mysql/libexec/mysqld: Shutdown complete
|
|
1
2
3
4
|
[[email protected] tmp]# ps -ef | grep mysqldroot 22330 20131 0 13:24 pts/2 00:00:00 grep mysqld
[[email protected] tmp]# ps -ef | grep mysqlroot 22332 20131 0 13:24 pts/2 00:00:00 grep mysql
|
发现
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
[[email protected] mysql]# ./bin/ data/ include/ lib/ libexec/ log/ mysql-test/ share/ sql-bench/
[[email protected] mysql]# ./bin/comp_err mysqlbinlog mysql_find_rows mysqltestmanagercinnochecksum mysqlbug mysql_fix_extensions mysqltestmanager-pwgenmsql2mysql mysqlcheck mysql_fix_privilege_tables mysql_tzinfo_to_sqlmyisamchk mysql_client_test mysqlhotcopy mysql_upgrademyisam_ftdump mysql_config mysqlimport mysql_upgrade_shellmyisamlog mysql_convert_table_format mysql_install_db mysql_waitpidmyisampack mysqld_multi mysql_secure_installation mysql_zapmy_print_defaults mysqld_safe mysql_setpermission perrormysql mysqldump mysqlshow replacemysqlaccess mysqldumpslow mysql_tableinfo resolveipmysqladmin mysql_explain_log mysqltest resolve_stack_dump[[email protected] mysql]# ./bin/mysqld_safe &[1] 22367
[[email protected] mysql]# /data/mysql/bin/mysql -uroot -p123456Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.0.88-log Source distribution
No entry for terminal type "xterm";
using dumb terminal settings.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> Ctrl-C -- exit!Aborted[[email protected] mysql]# cd /tmp/.ICE-unix/ mysql.sock[[email protected] mysql]# cd /tmp/ |
终于进去了
终于备份好了,为了以后不必要的麻烦,添加service管理
|
1
2
3
4
|
[[email protected] data]# cp /data/mysql/share/mysql/mysql.server /etc/init.d/mysql
[[email protected] data]# cd /etc/init.d/
[[email protected] init.d]# chkconfig --add mysql
[[email protected] init.d]# chkconfig mysql on
|
这样方便多了
|
1
2
3
4
5
6
7
8
9
10
11
|
[[email protected] init.d]# service mysql stopMySQL manager or server PID file could not be found! [FAILED][[email protected] init.d]# service mysql startStarting MySQL. [ OK ][[email protected] init.d]# /data/mysql/bin/mysql -uroot -pWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.0.88-log Source distribution
No entry for terminal type "xterm";
using dumb terminal settings.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
终于解决了!
本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1382231