LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't connect to local mysql server through socket.................. (https://www.linuxquestions.org/questions/linux-newbie-8/cant-connect-to-local-mysql-server-through-socket-896154/)

cheeliong 08-08-2011 04:51 AM

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

kirukan 08-08-2011 05:01 AM

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

vickyk 08-08-2011 06:00 AM

Quote:

Originally Posted by cheeliong (Post 4436635)
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.

cheeliong 08-10-2011 02:34 AM

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!


All times are GMT -5. The time now is 09:48 PM.