LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2011, 04:51 AM   #1
cheeliong
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
can't connect to local mysql server through socket..................


hi everyone:
i am new member for this forum, i am doing copy data from virtualbox A centos machine to virtualbox B centos machine.
first step i use mysqldump database xxx > xxx.sql
than send to B machine by scp xxx.sql @B machine IP /root.
but come to third step, the xxx.sql need import to B machine mysql database,the error occur again:
# can't connect to local mysql server through socket 'opt/lampp/lampp/mysql/mysql.sock

i really dun know how to solve it, use almost 3 hour cannot do solve it,
but i use win scp check the folder, i found mysql.sock is no at the
/opt/lampp/lampp/mysql/mysql.sock but at
/opt/lampp/var/mysql/mysql.socp

i dun know how to continue it, i hope those centos user help me to overcome
the issue. thank you very much!
centos version 5.5, xampp version 1.4

Last edited by cheeliong; 08-10-2011 at 02:35 AM. Reason: solve the problem
 
Old 08-08-2011, 05:01 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Before restore the database on your second machine, please confirm following
1. mysql up and running
2. database already created
3. mysql -u username -ppassword databasename < dump.sql
 
Old 08-08-2011, 06:00 AM   #3
vickyk
Member
 
Registered: Dec 2009
Posts: 38

Rep: Reputation: 6
Quote:
Originally Posted by cheeliong View Post
i found mysql.sock is no at the
/opt/lampp/lampp/mysql/mysql.sock but at
/opt/lampp/var/mysql/mysql.socp
Check the my.cnf file. In that check what is the entry for socket file it should be /opt/lampp/var/mysql/mysql.sock if not change it to this.
Alternatively copy the file from /opt/lampp/var/mysql/ to /opt/lampp/lampp/mysql/ and try restarting mysql and then importing the database.
 
Old 08-10-2011, 02:34 AM   #4
cheeliong
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
thanks you very much, the problem was solve,

answer is i cannot use mysql one word to create command
i need type directory mysql to create command like
/opt/lampp/bin/mysql -u root databasename < xxx.sql

thank a lot everyone!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Frustration: Can't connect to local MySQL server through socket '/usr/local/mysql-5.0 nidala Linux - Newbie 1 09-27-2008 11:20 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration