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 error, failed, endless search for fix

Discussion in 'General Discussion' started by Secret Agent, Mar 2, 2005.

Thread Status:
Not open for further replies.
  1. Secret Agent

    Secret Agent Guest

    I spent way too long trying to fix this and search the cpanel forums, tried just about every possible method and nothing worked.

    i followed this and reinstalled mysql
    http://www.devside.net/web/server/linux/mysql

    Restarted in WHM and still get the same error:


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

    Nothing wants to work

    root [/]# cd /var/lib/mysql
    root [/var/lib/mysql]# chmod 771 *
    root [/var/lib/mysql]# chmod 777 mysql.sock
    chmod: failed to get attributes of `mysql.sock': No such file or directory
    root [/var/lib/mysql]# chmod 660 <hostname>.pid
    chmod: failed to get attributes of `server.myactualhostname.pid': No such file or directory

    I've tried everything and I can't believe nothing is working

    I rebooted the server as well and retried so many methods. I reset MySQL password and no luck. I don't know what else to do honestly.
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Asume you also tried /scripts/fixmysql?
     
  3. Secret Agent

    Secret Agent Guest

    Yes, does nothing

    root@server [~]# yum install mysql-server mysql
    Gathering header information file(s) from server(s)
    Server: Centos-3 - i386/i686 - Addons
    Server: Centos-3 - i386/i686 - Base
    Server: Centos-3 - i386/i686 - Extras
    Server: Centos-3 - i386/i686 - Updates
    Finding updated packages
    Downloading needed headers
    Cannot find a package matching mysql-server
    Cannot find a package matching mysql
    No actions to take
     
  4. easyhoster1

    easyhoster1 Well-Known Member

    Joined:
    Sep 25, 2003
    Messages:
    659
    Likes Received:
    0
    Trophy Points:
    16
    We got this error before.

    Make sure in your /etc/my.cnf you have this line
    [mysqld]
    socket=/tmp/mysql.sock << or path to your .sock file

    Then restart MSQL;

    If it fails when you restart, try again..Sometimes it takes a couple attempts to get it started.
     
  5. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

    this will link the existing mysql.sock to the /tmp folder

    run this in ssh
     
    #5 dave9000, Mar 2, 2005
    Last edited: Mar 2, 2005
  6. Secret Agent

    Secret Agent Guest

    Doesn't work :(

    Restarted mysql 3 times in a row via whm and got the same:

    /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").

    /etc/my.cnf is:

    [mysqld]
    port=3306
    set-variable = max_connections=500
    safe-show-database
    socket=/tmp/mysql.sock
    Code:
    root@server [/tmp]# ls
    ./                                     sess_78013b7aa072ce24442c85345b825781
    ../                                    sess_a3b628789127f7d775b1ccfb7a2e9ab3
    horde.log                              sess_ca21ca9acca102fec9d1c97c743e86a5
    .ICE-unix/                             sess_ef064dde9b2c5196ea8f0b3be6d57921
    lost+found/                            .s.PGSQL.5432=
    nobody-session-0.281111988079832       .s.PGSQL.5432.lock
    sess_6dac0d584196ca6e1802ed3b2cd991af
    
    Code:
    root@server [/var/lib/mysql]# ls
    ./                       ib_logfile0*   mysql/
    ../                      ib_logfile1*   paljapan_infofresh/
    astra_7art/              infofresh/     server-bin.001*
    eximstats/               info_fresh/    server-bin.index*
    horde/                   leechprotect/  server.info-fresh.com.err*
    ib_arch_log_0000000000*  mail/          server.pid*
    ibdata1*                 modsec/        test/
    
    This has been so hectic...unreal.
     
  7. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    remove this from the /etc/my.cnf socket=/tmp/mysql.sock

    restart mysql

    then

    in ssh

    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
     
  8. Secret Agent

    Secret Agent Guest

    Still getting the same error again
     
  9. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    ls /var/lib/mysql and ls /tmp in ssh

    does mysql.sock exist in both places ?
     
  10. Secret Agent

    Secret Agent Guest

    No, none of them
     
  11. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    without logging into the box and checking things this may be difficult

    first check the permissions of /var/lib/mysql

    make sure its 0755 and mysql:root

    chmod 0755 /var/lib/mysql

    chown mysql:root /var/lib/mysql

    cat /etc/passwd and make sure user mysql exists
     
  12. Secret Agent

    Secret Agent Guest

    I did those two and restarted mysql, same thing..

    This is from the server.hostname.pid.err file (last portion of it)

    050302 21:42:13 mysqld started
    050302 21:42:13 Warning: Asked for 196608 thread stack, but got 126976
    050302 21:42:13 InnoDB: Started
    050302 21:42:13 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    050302 21:42:13 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    050302 21:42:13 Aborting

    050302 21:42:13 InnoDB: Starting shutdown...
    050302 21:42:16 InnoDB: Shutdown completed
    050302 21:42:16 /usr/sbin/mysqld: Shutdown Complete

    050302 21:42:16 mysqld ended

    050302 21:42:55 mysqld started
    050302 21:42:55 Warning: Asked for 196608 thread stack, but got 126976
    050302 21:42:55 InnoDB: Started
    050302 21:42:55 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    050302 21:42:55 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    050302 21:42:55 Aborting

    050302 21:42:55 InnoDB: Starting shutdown...
    050302 21:42:57 InnoDB: Shutdown completed
    050302 21:42:57 /usr/sbin/mysqld: Shutdown Complete

    050302 21:42:57 mysqld ended
     
  13. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    does /var/lib/mysql/mysql/host.MYI exist ?

    and chmod -R 0660 /var/lib/mysql/mysql

    and chown -R mysql:mysql /var/lib/mysql/mysql

    if /var/lib/mysql/mysql/host.MYI does not exist then set the permissions and run

    /usr/bin/mysql_install_db
     
  14. Secret Agent

    Secret Agent Guest

    I ran that too and now this

    root@server [/var/lib/mysql]# cd / ; /usr/bin/mysqld_safe &
    [1] 6192
    root@server [/]# Starting mysqld daemon with databases from /var/lib/mysql
    STOPPING server from pid file /var/lib/mysql/server.myhostname.com.pid
    050302 22:05:12 mysqld ended


    [1]+ Done /usr/bin/mysqld_safe



    root@server [/var/lib/mysql]# /usr/bin/mysql_install_db
    Installing all prepared tables
    050302 22:02:21 Warning: Asked for 196608 thread stack, but got 126976
    050302 22:02:21 /usr/sbin/mysqld: Shutdown Complete


    To start mysqld at boot time you have to copy support-files/mysql.server
    to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h server.myhostname.com password 'new-password'
    See the manual for more instructions.

    NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
    the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
    able to use the new GRANT command!

    You can start the MySQL daemon with:
    cd / ; /usr/bin/mysqld_safe &

    You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
    cd sql-bench ; perl run-all-tests

    Please report any problems with the /usr/bin/mysqlbug script!

    The latest information about MySQL is available on the web at
    http://www.mysql.com
    Support MySQL by buying support/licenses at https://order.mysql.com
     
  15. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    what is the last part of the mysql log ?

    any indication of whats happening now ?
     
  16. Secret Agent

    Secret Agent Guest

    Weird...i can't find any mysql logs

    ???
     
  17. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    also start mysql with this string

    /usr/bin/mysqld_safe --user=mysql &

    or try it this way

    service mysql start
     
  18. Secret Agent

    Secret Agent Guest

    I also ran /scripts/mysqlup

    MySQL Setup Script Version 6.0
    Fetching version information from http://updates.cpanel.net/mysqlinstall/version (CURRENT)....Done
    This is the MySQL 4.1.10 installer release number 0 for platform
    MySQL-shared is out of date (MySQL-shared-4.0.23-0 != MySQL-shared-4.1.10-0)
    MySQL-shared-compat is out of date (MySQL-shared-compat-4.0.23-0 != MySQL-shared-compat-4.1.10-0)
    MySQL-devel is out of date (MySQL-devel-4.0.23-0 != MySQL-devel-4.1.10-0)
    MySQL-embedded is out of date (MySQL-embedded-4.0.23-0 != MySQL-embedded-4.1.10-0)
    MySQL-client is out of date (MySQL-client-4.0.23-0 != MySQL-client-4.1.10-0)
    MySQL-bench is out of date (MySQL-bench-4.0.23-0 != MySQL-bench-4.1.10-0)
    MySQL-server is out of date (MySQL-server-4.0.23-0 != MySQL-server-4.1.10-0)
    MySQL-shared is out of date (MySQL-shared-4.0.23-0 != MySQL-shared-4.1.10-0)
    Gathering header information file(s) from server(s)
    Server: Centos-3 - i386/i686 - Addons
    Server: Centos-3 - i386/i686 - Base
    Server: Centos-3 - i386/i686 - Extras
    Server: Centos-3 - i386/i686 - Updates
    Finding updated packages
    Downloading needed headers
    db4-devel is installed and is the latest version.
    pam-devel is installed and is the latest version.
    openssl096b is installed and is the latest version.
    openssl is installed and is the latest version.
    openssl-devel is installed and is the latest version.
    gcc is installed and is the latest version.
    glibc-devel is installed and is the latest version.
    compat-db is installed and is the latest version.
    zlib-devel is installed and is the latest version.
    rpm-build is installed and is the latest version.
    No actions to take
    Resetting MySQL to cPanel Defaults and Installing the Latest Version
    I ran out of mirrors for MySQL.


    Notice...even mirrors are no good...what a crappy day :(
     
  19. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
  20. Secret Agent

    Secret Agent Guest

    root@server [~]# Starting mysqld daemon with databases from /var/lib/mysql
    STOPPING server from pid file /var/lib/mysql/server.hostname.com.pid
    050302 22:23:55 mysqld ended
    <it hangs here for a long time, I have to hit enter to continue it>
    [1]+ Done /usr/bin/mysqld_safe --user=mysql

    root@server [~]# service mysql start
    root@server [~]#


    Restarted mysql again and same error
     
Loading...
Thread Status:
Not open for further replies.

Share This Page