• Home
  • mysql shut itself down, can't restart ?

  • mysql on my server just shut itself down and won't respond to restart commands...

    i get these errors
    [root@server1 /root]# Starting mysqld daemon with databases from /var/lib/mysql
    mysqld daemon ended
    mysqladmin variables
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql
    .sock' (111)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex
    ists!
    [root@server1 /root]# /etc/rc.d/init.d/mysql stop
    No mysqld pid file found. Looked for /var/lib/mysql/server1.eva2000.org.pid.
    [root@server1 /root]# /etc/rc.d/init.d/mysql start
    [root@server1 /root]# Starting mysqld daemon with databases from /var/lib/mysql
    mysqld daemon ended
    /etc/rc.d/init.d/mysql start
    [root@server1 /root]# Starting mysqld daemon with databases from /var/lib/mysql
    mysqld daemon ended and in server1.eva2000.org.pid the following

    mysqld ended on Sun Sep 24 20:04:50 CDT 2000
    mysqld started on Sun Sep 24 20:07:15 CDT 2000
    000924 20:07:15 Can't start server: Bind on TCP/IP port: Address already in use
    000924 20:07:15 Do you already have another mysqld server running on port: 3306 ?
    000924 20:07:15 Aborting

    mysqld ended on Sun Sep 24 20:07:15 CDT 2000
    mysqld started on Sun Sep 24 20:07:24 CDT 2000
    000924 20:07:24 Can't start server: Bind on TCP/IP port: Address already in use
    000924 20:07:24 Do you already have another mysqld server running on port: 3306 ?
    000924 20:07:24 Aborting

    mysqld ended on Sun Sep 24 20:07:24 CDT 2000
    mysqld started on Sun Sep 24 20:10:21 CDT 2000
    000924 20:10:21 Can't start server: Bind on TCP/IP port: Address already in use
    000924 20:10:21 Do you already have another mysqld server running on port: 3306 ?
    000924 20:10:21 Aborting


  • yeah i do have mysql.server script on my server... i decided to reboot the entire server, and mysql went back up.

    problem is figuring out what happened ? should i check if my databases have been corrupted in anyway ? how do i do that ?


  • this still happens now and again...

    could this be my problem

    http://www.sitepointforums.com/showthread.php?threadid=9935 ?


  • Doesn't sound like its shutdown to me, its still running (thus is can't open back up on the port that its meant to run on (default port for mysql = 3306)

    Do you have the mysql.server script handy? Try

    /usr/local/mysql/share/mysql.server stop

    then

    /usr/local/mysql/share/mysql.server start

    (if you can't find mysql.server in that directory, or perhaps its installed somewhere else do 'locate mysql.server' first)

    If it comes up with an error, do this first:

    chmod +x /path/to/mysql.server

    then try again, have you got mysqld running with --log= ? that'd be a good thing to do :)

    Hope this helps.


  • Originally posted by eva2000
    just msyql not responding at times

    Eva-

    What happens when MySQL stops responding? Are you getting errors, or it just seems like the database isn't running? Are you having any other problems when this happens?

    -Chris


  • It looks like MySQL was running, and using port 3306, but the mysql stop command couldn't shut down MySQL for whatever reason. The stop command isn't flawless, it stores the PID (process ID) of the server command, but if this was the incorrect PID, or if it changed for some reason, then the mysql stop would not be able to stop the server, and mysql start would of course say that the port was busy (since MySQL was really running).

    Rebooting the server is the cleanest way to fixing this up.


  • happen yet again :(

    this is getting annoying it doesn't seem to be a memory or key_buffer problem, just msyql not responding at times and mysql start and stop commands don't work cause mysql is apparently still running........


    reboot fixes it for a while until the next time this happens :(


  • Oppps yes check that the one in there still exists.... actually that's a better place for it then /tmp :)


  • okay i'll do that.... my mysql.sock is at /var/lib/mysql/mysql.sock so is that where i should be checking ?


  • Well just one thing to try would be not to start or stop MySQL through Webmin for a little bit. Just start and stop from telnet with /etc/rc.d/init.d/mysql start or /etc/rc.d/init.d/mysql stop

    Also, next time MySQL stops responding, try doing a mysqladmin -u root -p status from telnet to see if that returns anything. If not, make sure there is a file called "/tmp/mysql.sock" and do a "ps aux" to list all the processes running.

    -Chris


  • well i always notice the problem when i can't access my forum - so i check in webmin panel's mysql module and sure enough it is shut off so i think... normally all databases are shown on the mysql module page. but when this happen there's the submit button which says click this to start mysql server.

    I click it and nothing....

    go into telnet and stop or start and nothing

    this is what rackspace did
    Hello,

    I have changed the startup command for mysql in webmin from "/usr/sbin/safe_mysqld &" to "/etc/rc.d/init.d/mysql start." This
    should solve your webmin startup problem.

    Normally when you get an error starting up mysql, you can find out why by tailing the mysql error log. You can do this from a telnet prompt by typing in the following command:

    tail /var/lib/mysql/server1.eva2000.org.err

    This will show you the last few lines of this error log.

    The number one reason mysql won't start is because there is a (or a few) stray processess of mysql still running. If this happens, you can kill them using the following command.

    Use "ps -aux" to get the process ID and then use:

    kill -9

    Memory usage in Unix is different than memory usage on a Windows machine. On a Unix machine, major applications are memory resident until another application needs to take that memory. This causes
    your server to be more efficient because it doesn't have to keep clearing memory and re-reading from disk.
    i also reduced my join buffer down from 4MB to 3MB since i added the indexes in and reduced table_cache to 150

    right now it's has been running for 12 hrs at 42% memory usage with 19 members + 5 - 15 guests.

    It's really strange how memory usage patterns are, sometimes it would be 100% memory and 5% swap with only 5 - 10 members and some times up to 40 - 50 members at 65% memory and 0% swap ?


  • thanks chris and chris hehe

    seems to be exactly what was wrong or right ? rackspace said exactly the same thing

    for some strange reason after this particular reboot, mysql and my forums have been running very smoothly with no slow_queries at all when the forum is really busy...

    although memory usage is at 98%


  • ah ha !! ... chris i found my problem, even at /var/lib/mysql/mysql.sock the mysql.sock file is getting deleted somehow.

    My server and mysql are all down right now :(

    can it be deleted from that location /var/lib/mysql/mysql.sock ?


  • Originally posted by eva2000
    ah ha !! ... chris i found my problem, even at /var/lib/mysql/mysql.sock the mysql.sock file is getting deleted somehow.

    My server and mysql are all down right now :(

    can it be deleted from that location /var/lib/mysql/mysql.sock ?

    God I never knew running a board was so hard.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about mysql shut itself down, can't restart ? , Please add it free.