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

I am having trouble installing mysql-server.

I have done

> sudo apt-get install mysql-server

I get prompted to set a root password. Whether I opt to set one or not is fails and I get the following:

start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error      from a previous failure.
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I try

mysql -u root

I get

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

investigating...

> ls /var/run/mysqld/ -a

and the directory is empty.

Some other things I've done:

> sudo service mysql status
mysql stop/waiting

> service mysql start
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.88"
(uid=1000 pid=10047 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")

There are a number of similar questions, but none that I have found which resolve this problem.

Edit: Here is the result of cat /var/log/syslog | grep mysql after an install attempt

Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: To do so, start the server, then issue the following commands:
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: /usr/bin/mysqladmin -u root password 'new-password'
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: /usr/bin/mysqladmin -u root -h Fizgig password 'new-password'
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: Alternatively you can run:
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: /usr/bin/mysql_secure_installation
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: which will also give you the option of removing the test
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: databases and anonymous user created by default.  This is
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: strongly recommended for production servers.
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: See the manual for more instructions.
Apr 25 09:09:00 Fizgig mysqld_safe[4034]:   
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: Please report any problems with the /usr/scripts/mysqlbug script!
Apr 25 09:09:00 Fizgig mysqld_safe[4034]: 
Apr 25 09:09:06 Fizgig kernel: [ 3831.031113] type=1400 audit(1366844946.474:35): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4148 comm="apparmor_parser"
Apr 25 09:09:06 Fizgig kernel: [ 3831.273565] type=1400 audit(1366844946.718:36): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4184 comm="apparmor_parser"
Apr 25 09:09:06 Fizgig kernel: [ 3831.508895] init: mysql main process (4188) terminated with status 1
Apr 25 09:09:06 Fizgig kernel: [ 3831.509018] init: mysql main process ended, respawning
Apr 25 09:09:08 Fizgig kernel: [ 3832.597159] init: mysql post-start process (4189) terminated with status 1
Apr 25 09:09:08 Fizgig kernel: [ 3832.658028] type=1400 audit(1366844948.102:37): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4224 comm="apparmor_parser"
Apr 25 09:09:08 Fizgig kernel: [ 3832.924401] init: mysql main process (4228) terminated with status 1
Apr 25 09:09:08 Fizgig kernel: [ 3832.924496] init: mysql main process ended, respawning
Apr 25 09:09:09 Fizgig kernel: [ 3833.828638] init: mysql post-start process (4229) terminated with status 1
Apr 25 09:09:09 Fizgig kernel: [ 3833.890595] type=1400 audit(1366844949.334:38): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=4267 comm="apparmor_parser"
Apr 25 09:09:09 Fizgig kernel: [ 3834.100407] init: mysql main process (4271) terminated with status 1
Apr 25 09:09:09 Fizgig kernel: [ 3834.100528] init: mysql respawning too fast, stopped

I tried installing by installing LAMP as per comment, but the mysql server install part failed.

share|improve this question
    
While starting, please check if you are getting any error messages in this logfile /var/log/syslog –  thefourtheye Apr 24 '13 at 12:31
    
This isn't an answer as such - but you might use tasksel to install a LAMP stack, that's how I usually install MySQL and it's always been just fine. sudo apt-get install tasksel && sudo tasksel then choose too install LAMP (make sure you don't inadvertently deselect any of the options that are currently selected). –  Clive van Hilten Apr 24 '13 at 12:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.