Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

So first time putting up a LAMP stack on a Bodhi machine (previously experience with WAMP, and LAMP on 10.04); I got Apache going, and a Drupal install begun, then I go to create a new database and when I log in to phpmyadmin ... I get a 'cannot connect error'. Tracing this back, I am running into socket connection issues with mysql. Initially the problem looked like this:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Using ls -lart /var/run/my* I get this:

  total 0
  drwxr-xr-x  2 mysql root  40 Jan 31 11:56 .
  drwxr-xr-x 21 root  root 740 Jan 31 12:21 ..`

I ran touch /var/run/mysqld/mysqld.sock and set chown -R mysql /var/run/mysqld which allows for:

total 0
drwxr-xr-x 21 root  root 740 Jan 31 12:21 ..
-rw-r--r--  1 mysql root   0 Jan 31 13:58 mysqld.sock
drwxr-xr-x  2 mysql root  60 Jan 31 13:58 .
  • So when I try to run mysql -u root -p I get one error - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) (note it is no longer ERROR 2002...(2) but rather ERROR 2002...(13))
  • If I try service mysql restart (or stop, start) I get another error - start: Rejected send message, 1 matched rules; type="method_call", sender=":1.49" (uid=1000 pid=8407 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
  • When I run sudo service mysql restart I get stop: Unknown instance: start: Job failed to start
  • When I run service mysql status I get "mysql stop/waiting"

What can I do to diagnose the issues I am having with mysql? I may be overlooking an utterly simple mysql issue and would appreciate any feedback on what I've done so far.

Also, being a Bodhi machine and most of the instruction/feedback being written for Ubuntu, I am unsure to what extent any Ubuntu instruction may not apply. In particular, am I running into a problem related to the difference between /etc/init.d/... and service ... ... commands? Or, perhaps, am I running into a difference between libraries of the two?

share|improve this question

closed as off topic by Jorge Castro, da Boss, Eric Carvalho, Eliah Kagan, fossfreedom Feb 2 '13 at 9:31

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

Moved this to Unix (unix.stackexchange.com/q/63391/2515), this can be closed as off-topic as necessary –  mfg Feb 1 '13 at 18:23

Browse other questions tagged or ask your own question.