0

What should happen:

./lampp start mysql -u root -p

--All is right and well with the world!--

What actually happens, and in this order:

./lampp start

mysql -u root -p

[Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)]

{at this point, phpmyinfo() shows mysql as activated}

sudo service mysql start

mysql -u root -p

[Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)]

{phpmyinfo() still shows mysql as activated}

./lampp stop

mysql -u root -p

(all is right and well with the world!)

./lampp start

Another MySQL daemon is already running...

{phpmyinfo() shows mysql as deactivated}

Basically, it seems there's some conflict going with mySQL. If I have apache running, I can't run mysql, but if I have mySQL running, I can't load it in Apache. The error remains the same. Both are trying to use the same socket, and it works if Apache isn't running. Any suggestions all would be extremely appreciated.

1 Answer 1

0

Tom,

check your my.cnf for the path to the socket file under the mysqld and client section.

[mysqld] socket=/path/to/socket [client] socket=/path/to/socket 

Edit:

If the [client] section doesn't exist then put it there so you don't have to manually specify the --socket=path when connecting from command line.

8
  • socket = /opt/lampp/var/mysql/mysql.sock there is nothing called mysql.sock in that folder, however. Commented Apr 11, 2011 at 17:37
  • When connecting try using mysql --socket=/opt/lampp/var/mysql/mysql.sock -u root -p Commented Apr 11, 2011 at 17:45
  • ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Commented Apr 11, 2011 at 17:51
  • Tried a few times, typing my password carefully. But at least it's a different error! Any idea what I can edit so I don't have to do that manually every time? Commented Apr 11, 2011 at 17:52
  • Try without the -p maybe the password is not set yet. To not have to enter the socket path see the answer. I editted it to include the solution. Commented Apr 11, 2011 at 17:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.