Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

OS: Ubuntu 12.04

Command: sudo /etc/init.d/mysqld start

Occasionally mysqld failed to start. I don't make any changes in my.cnf or any other configuration on this laptop. One day it's ok, another I have this error.

syslog:
Aug 11 11:09:14 oleg-laptop kernel: [ 1915.342628] type=1400 audit(1344708554.812:75): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=5808 comm="apparmor_parser"
Aug 11 11:09:16 oleg-laptop kernel: [ 1917.039784] init: mysql main process (5812) terminated with status 1
Aug 11 11:09:16 oleg-laptop kernel: [ 1917.039816] init: mysql main process ended, respawning
Aug 11 11:09:16 oleg-laptop kernel: [ 1917.382623] init: mysql post-start process (5813) terminated with status 1
Aug 11 11:09:16 oleg-laptop kernel: [ 1917.396212] type=1400 audit(1344708556.868:76): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=5859 comm="apparmor_parser"
Aug 11 11:09:18 oleg-laptop kernel: [ 1918.981751] init: mysql main process (5863) terminated with status 1
Aug 11 11:09:18 oleg-laptop kernel: [ 1918.981774] init: mysql main process ended, respawning
Aug 11 11:09:18 oleg-laptop kernel: [ 1919.436244] init: mysql post-start process (5864) terminated with status 1
Aug 11 11:09:18 oleg-laptop kernel: [ 1919.455425] type=1400 audit(1344708558.928:77): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=5910 comm="apparmor_parser"
Aug 11 11:09:20 oleg-laptop kernel: [ 1921.155101] init: mysql main process (5914) terminated with status 1
Aug 11 11:09:20 oleg-laptop kernel: [ 1921.155165] init: mysql respawning too fast, stopped

/var/log/mysql.err and mysql.log are empty.

Any clue?

UPD:

When starting deamon manually I have interesting output:

Command: sudo -u mysql mysqld
....
120811 11:28:19 [Note] Server hostname (bind-address): '192.168.1.3'; port: 3306
120811 11:28:19 [Note]   - **'192.168.1.3' resolves to '192.168.1.3'**;
120811 11:28:19 [Note] **Server socket created on IP: '192.168.1.3'**.
120811 11:28:19 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
120811 11:28:19 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120811 11:28:19 [ERROR] Aborting

But

Command: ifconfig
...
wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          **inet addr:192.168.1.2**  Bcast:192.168.1.255  Mask:255.255.255.0

Which means mysql tries to bind to 192.168.1.3 while actual IP address is 192.168.1.2. Any ideas why that could happen? Laptop is connected to Wi-Fi DHCP network.

share|improve this question
    
Maybe related -- tanghus.net/2012/03/yet-another-mysql-vs-apparmor-barf –  Chida Aug 11 '12 at 18:19
    
Thanks, I tried this solution. No changes, so far. –  Oleg Aug 11 '12 at 18:41
    
Ok, here is the solution to this issue: In my.cnf file there was a line: bind-address = 192.168.1.3 After changing it to bind-address = localhost Mysql started normally. I'm pretty sure, I didn't put the IP address there manually, so it was added there by mysql itself. Well, be careful with mysql and DHCP then. –  Oleg Aug 11 '12 at 19:00
add comment

2 Answers

try any of these:

  • Try to disable aparmor
  • Try to re-install mysql Or rest of the solutions are mentioned in this url:

https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/573318

share|improve this answer
    
After finding this networking issue, not sure the problem is in apparmor. Don't want to reinstall now, but it maybe an option, though –  Oleg Aug 11 '12 at 18:44
    
have you went through all the solutions mentioned in the URL i posted? –  Farhan Aug 11 '12 at 18:45
    
Yes, I tried everything from there. Actually I took an idea to start mysql manually and see the output from there. Thanks! –  Oleg Aug 11 '12 at 18:52
add comment
up vote 0 down vote accepted

Ok, here is the solution to this issue:

In my.cnf file there was a line:

bind-address = 192.168.1.3

After changing it to

bind-address = localhost

Mysql started normally. I'm pretty sure, I didn't put the IP address there manually, so it was added there by mysql itself. Well, be careful with mysql and DHCP then.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.