mySQL not Starting

I've had my server off for about 5min, and I did a copy of my Linode to another Linode, however when I restarted the server, I can't get the mySQL server to start again.

I try the following command to start:

/etc/init.d/mysql start

and it tries to start the mySQL server, but failes in the end.

11 Replies

On my server (fedora) mysql server is started with:

service mysqld start

You could try that.

I managed to get this to work, although I'm hoping it is only temporary.

All I needed to do was change the bind-address in the my.cnf file to the IP address of the server. My only concern is that this is not as secure as use 127.0.0.1 which won't allow me to start mysql server.

Any ideas as to why? And how to fix it?

Did you leave out the error message on purpose?

what does the mysql error log say? that would be helpfull.

@alrikb:

On my server (fedora) mysql server is started with:

service mysqld start

You could try that.

FYI: "/sbin/service" is just a script that calls the /etc/init.d/* scripts.

@Alucard:

Did you leave out the error message on purpose?
Which error messages?

@Stu:

what does the mysql error log say? that would be helpfull.
The Error log file has 0 file size.

–----

The following is the syslog file during a failed mySQL Shutdown and Restart:

Dec 17 17:29:01 mail mysqld[4026]: 091217 17:29:01 [Note] /usr/sbin/mysqld: Normal shutdown
Dec 17 17:29:01 mail mysqld[4026]: 
Dec 17 17:29:01 mail mysqld[4026]: 091217 17:29:01  InnoDB: Starting shutdown...
Dec 17 17:29:03 mail mysqld[4026]: 091217 17:29:03  InnoDB: Shutdown completed; log sequence number 0 1262942
Dec 17 17:29:03 mail mysqld[4026]: 091217 17:29:03 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 17 17:29:03 mail mysqld[4026]: 
Dec 17 17:29:03 mail mysqld_safe[4162]: ended
Dec 17 17:29:03 mail mysqld_safe[4243]: started
Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03  InnoDB: Started; log sequence number 0 1262942
Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Do you already have another mysqld server running on port: 3306 ?
Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Aborting
Dec 17 17:29:03 mail mysqld[4246]: 
Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03  InnoDB: Starting shutdown...
Dec 17 17:29:06 mail mysqld[4246]: 091217 17:29:06  InnoDB: Shutdown completed; log sequence number 0 1262942
Dec 17 17:29:06 mail mysqld[4246]: 091217 17:29:06 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 17 17:29:06 mail mysqld[4246]: 
Dec 17 17:29:06 mail mysqld_safe[4277]: ended
Dec 17 17:29:17 mail /etc/init.d/mysql[4407]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Dec 17 17:29:17 mail /etc/init.d/mysql[4407]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Dec 17 17:29:17 mail /etc/init.d/mysql[4407]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Dec 17 17:29:17 mail /etc/init.d/mysql[4407]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Dec 17 17:29:17 mail /etc/init.d/mysql[4407]: 

Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Do you already have another mysqld server running on port: 3306 ?

So, what else is using that port ? netstat -alnp | grep 3306

With the mySQL server stopped, nothing appears for that command.

There obviously can't be anything running on that port since I can start mySQL when the bind-address in my.cnf is set to the internet IP address rather than the localhost IP address of 127.0.0.1

Obviously something is running on port 3306 that is using the 127.0.0.1 IP address.

I've just worked out what the problem was.

The reason I couldn't start it was that the loopback device hadn't started.

I've now got it working, thanks guys.

@sphinx:

There obviously can't be anything running on that port since I can start mySQL when the bind-address in my.cnf is set to the internet IP address rather than the localhost IP address of 127.0.0.1

FYI: Each IP has its own ports, so a service can be running on 127.0.0.1:3306, but not your public IP:3306. Or, you can run a service on 0.0.0.0: which binds it to all available IPs. The netstat command will show you which IPs & ports are being used by which services.

@sphinx:

Dec 17 17:29:03 mail mysqld[4246]: 091217 17:29:03 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address

Do you actually have 127.0.0.1 assigned to "lo" properly? Sounds like your network config may not be properly setup…

ETA: Ah, I see you worked that out yourself as well.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct