skip to content

Connecting Mysql browser to mysql running in Xampp setup

Setup :

  • Ubuntu 7.04
  • installed Xampp 4 linux manually using the steps provided at that page. Default credentials is root without a password
  • Installed Mysql Browser by selecting it in the easy to use software install tool. Application > Add/Remove > Programming (make sure you have selected 'All Open Source Applications' in top right selection box)

Problem:

  • Started xampp through a shortcut 'gksu /opt/lampp/lampp restart'
  • Started Mysql Browser through Application > Programming > Mysql browser
    • Create a new connection
      •   Server : localhost
      •   Port : 3306
      •   Username : root
      •   Password :
      •   Default schema :
    • Press Connect
    • Get an error like
      Could not connect to host 'localhost'.
      MySQL Error Nr. 2002
      Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Solution:

For a standard Xampp installation the socket file is NOT located at /var/run/ ... but inside the /opt/lampp installation.

  • open /opt/lamp/etc/my.cnf and read that the socket is located at /opt/lampp/var/mysql/mysql.sock
  • In the connection box of mysql browser click the "Details" button and fill in the above value in the 'Connect using Socket file' box
  • Press Connect again.
  • You're connected !!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hello I have installed xampp

Hello

I have installed xampp and I need to connect to mysql with the prompt. Please I don't know which commands I have to write.
Please do you know the commands??
thanks you

For the use with other

For the use with other Applications, which can't be configured by a 'Connect using Socket file' box you could create a symbolic soft link in the expected directory, like '/var/run/mysqld/mysql.sock' which refers to '/opt/lampp/var/mysql/mysql.sock'.

cd /var/run
mkdir mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock mysqld.sock

This works for me, when trying to connect amarok to mysql.

Thanks for that tip.. It's

Thanks for that tip.. It's always nice when you can use symbolic links to fool linux ;)

HEY! thanks for this very

HEY! thanks for this very helpful instructions ! saved me from reinstalling mysql !

Powered by Drupal. CrystalX theme created by Nuvio | Webdesign.