Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: mySQL not Starting
PostPosted: Thu Dec 17, 2009 3:11 am 
Offline
Senior Newbie

Joined: Thu Jan 22, 2009 7:20 pm
Posts: 11
Website: http://wpthoughts.com/
Location: Sydney
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:
Code:
/etc/init.d/mysql start

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


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 4:51 am 
Offline
Newbie

Joined: Thu Dec 03, 2009 11:06 am
Posts: 4
On my server (fedora) mysql server is started with:

service mysqld start

You could try that.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 4:59 am 
Offline
Senior Newbie

Joined: Thu Jan 22, 2009 7:20 pm
Posts: 11
Website: http://wpthoughts.com/
Location: Sydney
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?


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 12:02 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
Did you leave out the error message on purpose?


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 1:37 pm 
Offline
Senior Newbie

Joined: Tue Dec 15, 2009 10:11 am
Posts: 7
what does the mysql error log say? that would be helpfull.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 3:34 pm 
Offline
Senior Newbie

Joined: Wed May 06, 2009 2:49 pm
Posts: 19
alrikb wrote:
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.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 6:34 pm 
Offline
Senior Newbie

Joined: Thu Jan 22, 2009 7:20 pm
Posts: 11
Website: http://wpthoughts.com/
Location: Sydney
Alucard wrote:
Did you leave out the error message on purpose?

Which error messages?

Stu wrote:
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:
Code:
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]:


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 8:12 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Code:
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


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 9:20 pm 
Offline
Senior Newbie

Joined: Thu Jan 22, 2009 7:20 pm
Posts: 11
Website: http://wpthoughts.com/
Location: Sydney
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.


Top
   
 Post subject: SOLVED
PostPosted: Thu Dec 17, 2009 9:24 pm 
Offline
Senior Newbie

Joined: Thu Jan 22, 2009 7:20 pm
Posts: 11
Website: http://wpthoughts.com/
Location: Sydney
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.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 10:33 pm 
Offline
Senior Newbie

Joined: Wed May 06, 2009 2:49 pm
Posts: 19
sphinx wrote:
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:<port> which binds it to all available IPs. The netstat command will show you which IPs & ports are being used by which services.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 10:55 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
sphinx wrote:
Code:
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.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group