The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL failed

Discussion in 'General Discussion' started by redcamel, Jun 27, 2005.

  1. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    This is from MySQL log file. MySQL is always in a failed state....

    Number of processes running now: 0
    050627 03:09:09 mysqld started
    050627 3:09:09 /usr/sbin/mysqld: unknown variable 'old_passwords=1'

    050627 03:09:09 mysqld ended

    050627 03:15:20 mysqld started
    050627 3:15:20 /usr/sbin/mysqld: unknown variable 'old_passwords=1'

    050627 03:15:20 mysqld ended
     
  2. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    Did you downgrade from MySQL 4.1 to 4.0 ? If so.. good luck.. plus.. remove that line from the /etc/my.cnf file.
     
  3. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Nope base minimal CentOS 4.1 then cPanel shell script that only things on the box.
     
  4. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    commented out the old_passwords=1 and now got this in the log:

    050627 04:30:24 mysqld started
    050627 4:30:25 Warning: Asked for 196608 thread stack, but got 126976
    Fatal error: Can't change to run as user 'mysql'. Please check that the user ex
    ists!
    050627 4:30:25 Aborting
    050627 4:30:25 /usr/sbin/mysqld: Shutdown Complete
    050627 04:30:25 mysqld ended

    However in WHM GUII see this error:

    Attempting to restart mysql
    Waiting for mysql to restart.... . . . . . . . . . . finished.
    mysql status
    /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

    This error is the same with the old_passwords there and comment out. Any ideas???
     
  5. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    Try "service mysql stop" "service mysql start"

    Else, re-create the symlink..

    Also, I had asked about MySQL not the OS.. Can you clarify that for us ?
     
  6. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
  7. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    More info:

    ls -l /var/lib/
    drwxr-x--x 4 27 27 4096 Jun 27 04:30 mysql

    ls -l /var/lib/mysql
    total 20528
    -rw-rw---- 1 27 27 5242880 Jun 27 03:06 ib_logfile0
    -rw-rw---- 1 27 27 5242880 Jun 27 03:06 ib_logfile1
    -rw-rw---- 1 27 27 10485760 Jun 27 03:06 ibdata1
    drwx------ 2 27 27 4096 Sep 25 2003 mysql
    drwx------ 2 27 27 4096 Sep 25 2003 test

    -----------------------------------------------------------------------

    [root@inet etc]# cat my.cnf
    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [mysqld_safe]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    -----------------------------------------------------------------------------------

    Also no mysql user in /etc/passwd
     
  8. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    root:x:0:0:root:/root:/bin/bash
    bin:x:1:1:bin:/bin:/sbin/nologin
    daemon:x:2:2:daemon:/sbin:/sbin/nologin
    adm:x:3:4:adm:/var/adm:/sbin/nologin
    lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
    sync:x:5:0:sync:/sbin:/bin/sync
    shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
    halt:x:7:0:halt:/sbin:/sbin/halt
    mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
    news:x:9:13:news:/etc/news:
    uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
    operator:x:11:0:eek:perator:/root:/sbin/nologin
    games:x:12:100:games:/usr/games:/sbin/nologin
    gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
    ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
    nobody:x:99:99:Nobody:/:/sbin/nologin
    apache:x:48:48:Apache:/var/www:/sbin/nologin
    mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
    smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
    sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
    named:x:25:25:Named:/var/named:/sbin/nologin
    pcap:x:77:77::/var/arpwatch:/sbin/nologin
    vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
    rpm:x:37:37::/var/lib/rpm:/sbin/nologin
    nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
    rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
    canna:x:39:39:Canna Service User:/var/lib/canna:/sbin/nologin
    webalizer:x:67:67:Webalizer:/var/www/usage:/sbin/nologin
    cyrus:x:76:12:Cyrus IMAP Server:/var/lib/imap:/bin/bash
    cpanel:x:32001:502::/usr/local/cpanel:/bin/bash
    mailman:x:32002:503::/usr/local/cpanel/3rdparty/mailman:/bin/bash
     
  9. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    No...I just let the shell script install everything. Do I need to down grade?
     
  10. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    I think there is some confusion here. Is this an existing server or a new server ? What shell script is it you are referring to ? If its a new server, make sure to run through the WHM setup process. If that is already complete, try modifying or reseting the MySQL root password via WHM ( make sure it is not the same as your servers "root" user password ).

    Failing that, try /scripts/mysqlup --force
     
  11. redcamel

    redcamel Member

    Joined:
    Jun 23, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I got it I had mess up premissions and no mysql user
     
  12. sagogreg

    sagogreg Registered
    PartnerNOC

    Joined:
    Jul 25, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I am having the same problem on a fresh install of CentOS 4.1

    I am not able to start mysqld.

    I have tried mysqlup --force as well as upcp --force.

    I have commented out the old_passwords line in my.cnf

    now I get

    050731 2:23:12 InnoDB: Started
    050731 2:23:12 Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
    050731 2:23:12 Aborting

    050731 2:23:12 InnoDB: Starting shutdown...
    050731 2:23:14 InnoDB: Shutdown completed
    050731 2:23:14 /usr/sbin/mysqld: Shutdown Complete

    is this a known bug in the install? If so is there a workaround?
     
  13. rviradia

    rviradia Well-Known Member

    Joined:
    Jul 25, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Also have the same problem with centos 3

    /scripts/mysqlup --force doesn't work

    Warning, no valid mysql.sock file found.
    mysql has failed
     
  14. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    what does

    rpm -qa | grep MySQL

    on shell as root give ?
     
  15. rviradia

    rviradia Well-Known Member

    Joined:
    Jul 25, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    That command ( rpm -qa | grep MySQL ) helped me fix it,

    I hit 'Rebuild RPM Database', re-ran upcp --force and that fixed the problem,

    Thanks!
     
  16. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
    glad to know it is fixed.
     
  17. welo

    welo Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Wow. My box was hung and the NOC rebooted it and MySQL was crashed system-wide. This thread was a lifesaver. :)
     
  18. jfoc

    jfoc Well-Known Member

    Joined:
    Sep 17, 2004
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello guys,
    I just find the solution for this problem, this solution is got from my try and error when i got this problem in my new server. Here's :

    1. Check your default mysql database installed in /var/lib/mysql/mysql
    2. If you see many files of default mysql database then go to step 5, if not go to step 3
    3. Run /usr/bin/mysql_install_db --user=mysql
    4. Start your MySQL
    5. Check your MySQL process using (ps aux | grep mysqld)
    5. Finish

    I hope my experience and solution could fix this MySQL problem.

    Best Regards,
    Joko Frank Octo
     
  19. hicom

    hicom Well-Known Member

    Joined:
    May 23, 2003
    Messages:
    272
    Likes Received:
    0
    Trophy Points:
    16
    Thanks Joko! That indeed fixes it. Should read the mySQL Docs next time to initiate the DB.

    Btw, on FreeBSD the command will be /usr/local/bin/mysql_install_db --user=mysql

    This is only to be ran if you find the error: unable to find mysql.host inside your /var/db/mysql/server.name.err
     
  20. vandal

    vandal Member

    Joined:
    May 14, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1

    you rock, thanks!
     
Loading...

Share This Page