Welcome to WebmasterWorld Guest from 54.145.209.34

Forum Moderators: bakedjake

Problem after migrating to Xampp

   
9:52 pm on Apr 24, 2010 (gmt 0)

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I had the default installations of php mysql and apache but changed it around to use xampp. Main reason being having everything in the one folder so it could all be backed up as one, and also for rsynking between machines.

But I hit a problem. I used the package manager to remove the server and db then downloaded and installed Xampp. The install went fine and i was up and running in next to no time. The problem came when i tried to import my largest SQL file.

Its 400+ meg so there was no way phpMyAdmin would be able to handle it. I went into shell and when I try from there it gives the following error...

root@mack-desktop:/opt/lampp/bin# mysql -uroot -ppassword -h localhost uk < /home/mack/Documents/Websites/example/data/datafile.sql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


It seams as if mysql client is still trying to reference the old install.

Can this be altered in a config file?

Mack.
8:57 am on Apr 25, 2010 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The connection to the MySQL server is controlled in the my.cnf file. You can find it probably in your /etc directory. The [mysqld] section contains the settings used by the server when it starts up. The [client] section contains the settings for the mysql command-line client. In both sections there is a line:

socket=some path

These two lines in the [mysqld] and [client] section must be the same. Otherwise the client is unable to find the server.
1:38 pm on Apr 25, 2010 (gmt 0)

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Lammert, thank you very much for your reply.

Now it gets interesting. The default Ubuntu install of mysql is Root > etc > mysql and that folder is still present. It doesn't have the actual DB server but it does have my.cnf

Because I removed mysql and them reinstalled in another location opt > lampp... the paths will be totally wrong. I did however install mysql client through the package manager so it will almost certainly be trying to use the default my.cnf file.

Should I un-install mysql client and do a manual install from source, or just edit the default my.cnf file.

Thanks again.

Mack.
1:56 pm on Apr 25, 2010 (gmt 0)

WebmasterWorld Senior Member lammert is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The MySQL server and the client are two different software packages and they work independent of each other. You should be fine editing the my.cnf which is used by the client. You may have two my.cnf files now on different locations because your XAMPP installation uses the /opt tree, while the client is /etc oriented.

The client doesn't need to know the directory path where the server or the databases are located. All it does is connect to the server through a socket or through a network connection, depending on the settings in the my.cnf file.
2:12 pm on Apr 25, 2010 (gmt 0)

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Thank you very much, issue now resolved.. removed the default my.cnf and copied the Xampp version to the location of the default file. Now works fine!

Thanks again.

Mack.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month