View previous topic :: View next topic |
Author |
Message |
Advanced n00b
Joined: 30 Mar 2006 Posts: 15 Location: Denmark
|
Posted: Fri Jan 05, 2007 11:22 pm Post subject: MySQL won't start with backup-/var/lib/mysql [SOLVED] |
|
|
Hi
I just copied the /var/lib/mysql-dir from a dying server.. It couldn't start mysql or anything so I couldn't make a dump of the database, so I only have the /var/lib/mysql-dir left.
I copy the dir into place in /var/lib/mysql and try to start the mysqld with /etc/init.d/mysql start
It tells me that its started, but it dies shortly after (I can see with ps aux) .. the /var/log/mysql/mysqld.err tells:
Code: |
070105 16:40:50 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=server-bin' to avoid this problem.
070105 16:40:55 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=server-bin' to avoid this problem.
070105 16:41:19 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=server-bin' to avoid this problem.
070105 16:41:19 [Note] //usr/sbin/mysqld: ready for connections.
Version: '5.0.26-log' socket: '//var/run/mysqld/mysqld1357.sock' port: 0 Gentoo Linux mysql-5.0.26-r1
070105 16:41:36 [Note] //usr/sbin/mysqld: Normal shutdown
070105 16:41:36 [Note] //usr/sbin/mysqld: Shutdown complete
|
When I try to start mysqld by hand (by running the mysqld-command) I get:
Code: |
mysqld: File './server-bin.1' not found (Errcode: 13)
070106 0:15:15 [ERROR] Could not use server-bin for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
070106 0:15:15 [ERROR] Aborting
070106 0:15:15 [Note] mysqld: Shutdown complete
|
Both the mysql-version on the old server (which I copied the dir from) and the server I'm trying to put the data into is running version 4.1. (On the new I just downgraded from 5.0 .. nothing has been installed and I erased /var/lib/mysql before installing 4.1 (If you wonder what that "Gentoo Linux mysql-5.0.26-r1" means in the log.. Don't know why it's writing that either )
I've tried to run mysql_fix_priv.., mysql_repair and so on but they all requires the mysqld to be turned on so I get an socket-missing error..
Anyone could help me get my data back? Thanks..
Last edited by Advanced on Sat Jan 06, 2007 11:00 pm; edited 1 time in total |
|
Back to top |
|
|
steveb Advocate
Joined: 18 Sep 2002 Posts: 4564
|
Posted: Sat Jan 06, 2007 12:00 am Post subject: |
|
|
can you post the output of this command: Code: | find /var/lib/mysql/ -maxdepth 1 -type f | and the output of this command: Code: | grep "^\(server\-id\|log\-bin\)" /etc/mysql/my.cnf |
|
|
Back to top |
|
|
Advanced n00b
Joined: 30 Mar 2006 Posts: 15 Location: Denmark
|
Posted: Sat Jan 06, 2007 8:46 am Post subject: |
|
|
Code: |
server ~ # find /var/lib/mysql/ -maxdepth 1 -type f
/var/lib/mysql/server-bin.000001
/var/lib/mysql/server-bin.index
/var/lib/mysql/server-bin.000002
/var/lib/mysql/server-bin.000003
/var/lib/mysql/server-bin.000004
/var/lib/mysql/ibdata1
/var/lib/mysql/ib_logfile0
/var/lib/mysql/ib_logfile1
/var/lib/mysql/server-bin.000005
/var/lib/mysql/server-bin.000006
/var/lib/mysql/server-bin.000007
/var/lib/mysql/server-bin.000008
/var/lib/mysql/server-bin.000009
/var/lib/mysql/server-bin.000010
/var/lib/mysql/server-bin.000011
/var/lib/mysql/server-bin.000012
/var/lib/mysql/server-bin.000013
/var/lib/mysql/server-bin.000014
/var/lib/mysql/server-bin.000015
/var/lib/mysql/server-bin.000016
/var/lib/mysql/server-bin.000017
/var/lib/mysql/server-bin.000018
/var/lib/mysql/server-bin.000019
/var/lib/mysql/server-bin.000020
/var/lib/mysql/server-bin.000021
/var/lib/mysql/server-bin.000022
/var/lib/mysql/server-bin.000023
/var/lib/mysql/server-bin.000024
/var/lib/mysql/server-bin.000025
/var/lib/mysql/server-bin.000026
/var/lib/mysql/server-bin.000027
/var/lib/mysql/server-bin.000028
/var/lib/mysql/server-bin.000029
/var/lib/mysql/server-bin.000030
/var/lib/mysql/server-bin.000031
/var/lib/mysql/server-bin.000032
/var/lib/mysql/server-bin.000033
/var/lib/mysql/server-bin.000034
/var/lib/mysql/server-bin.000035
/var/lib/mysql/server-bin.000036
/var/lib/mysql/server-bin.000037
/var/lib/mysql/server-bin.000038
/var/lib/mysql/server-bin.000039
/var/lib/mysql/server-bin.000040
/var/lib/mysql/server-bin.000041
/var/lib/mysql/server-bin.000042
/var/lib/mysql/server-bin.000043
/var/lib/mysql/advancedserv-bin.000001
/var/lib/mysql/advancedserv-bin.index
|
And
Code: |
log-bin
server-id = 1
|
|
|
Back to top |
|
|
Advanced n00b
Joined: 30 Mar 2006 Posts: 15 Location: Denmark
|
Posted: Sat Jan 06, 2007 10:54 pm Post subject: |
|
|
removed the /var/lib/mysql dir again and installed a new mysql-config (emerge --config dev-db/mysql) and then copied the subdirs from my var/lib/mysql-backup (the databases) into the new /var/lib/mysql and started mysql and dumped the databases with #mysqldump -u root -p <dbname> > <dbname>.sql |
|
Back to top |
|
|
stackoverflow128 n00b
Joined: 03 Jan 2013 Posts: 2
|
Posted: Thu Jan 03, 2013 4:28 pm Post subject: a little gotcha |
|
|
When using webapp-config I tripped over the fact that in
/etc/apache2/vhosts.d/default_vhost.include
the DocumentRoot was localhost and using anything but this broke webapp until I changed to to match other directories in /var/www |
|
Back to top |
|
|
|