MySQL Forums
Forum List  »  Backup

Unable to connect to Mysql after restore from backup
Posted by: Roni Alboim
Date: January 23, 2012 06:10AM

I restore a backup (using ibbackup --apply-log & innobackup --copy_back) to a diffrent server. At the end of the restore that ended up successfully (120123 06:07:55 innobackup: innobackup completed OK!) I tried to connect and got the following error:

root@mysql-staging-01 data]# mysql -u system -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

The log file is:

-- === /var/log/mysqld.log ====================
120123 06:32:06 mysqld_safe Starting mysqld daemon with databases from /opt/mysql/data/
120123 6:32:07 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
120123 6:32:07 InnoDB: Initializing buffer pool, size = 4.0G
120123 6:32:08 InnoDB: Completed initialization of buffer pool
120123 6:32:08 InnoDB: highest supported file format is Barracuda.
InnoDB: The log file was created by ibbackup --apply-log at
InnoDB: ibbackup 120123 4:49:18
InnoDB: NOTE: the following crash recovery is part of a normal restore.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
120123 6:32:08 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 109537, file name ./mysql01-bin.015027
120123 6:32:25 InnoDB Plugin 1.0.15 started; log sequence number 626898411020
120123 6:32:25 [Note] Event Scheduler: Loaded 0 events

120123 6:32:25 [Note] /opt/mysql/current/bin/mysqld: ready for connections.
Version: '5.1.55' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

The my.cnf is:
mysql]# grep sock /etc/my.cnf
socket=/var/lib/mysql/mysql.sock

When creating:

mysql]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

Then I can connect

mysql]# /opt/mysql/current/bin/mysql -u system -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.55 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Any idea why it trys to use '/tmp/mysql.sock' and not '/var/lib/mysql/mysql.sock'?

TX,

Roni



Edited 1 time(s). Last edit at 01/23/2012 06:13AM by Roni Alboim.

Options: ReplyQuote


Subject
Views
Written By
Posted
Unable to connect to Mysql after restore from backup
6010
January 23, 2012 06:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.