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 problem

Discussion in 'General Discussion' started by mpi, Apr 2, 2006.

  1. mpi

    mpi Well-Known Member

    Joined:
    Mar 29, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    okay so i just got cpanel up and working, but when i go to phpmyadmin, i see:

    Code:
    Wrong username/password. Access denied.
    and when i try to restart the mysql database through cpanel, i get:
    Code:
    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").

    why is this happening?
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    As the error suggest there is no mysql.sock file in /var/lib/mysql/

    To correct the error, do the following :-
    chmod 1777 /tmp
    /scripts/mysqlup --force
    service mysql restart

    Try the above commands and paste the error if any.
     
  3. mpi

    mpi Well-Known Member

    Joined:
    Mar 29, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    sad

    it gave a lot of errors....most of them saying it couldn't find the sock file.

    tmp folder is 777

    here is the last few lines:

    Code:
    100%[====================================>] 265,400      799.63K/s             
    
    00:54:42 (798.51 KB/s) - `/var/spool/cpupdates/MySQL-shared-4.0.25-0.i386.rpm' saved [265400/265400]
    
    MySQL-shared-4.0.25-0
    Preparing...                ########################################### [100%]
       1:MySQL-shared           ########################################### [100%]
    
    Waiting for MySQL to restart ...
    This scripts updates the mysql.user, mysql.db, mysql.host and the
    mysql.func tables to MySQL 3.22.14 and above.
    
    This is needed if you want to use the new GRANT functions,
    CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23
    
    If you get 'Access denied' errors, you should run this script again
    and give the MySQL root user password as an argument!
    Converting all privilege tables to MyISAM format
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    If your tables are already up to date or partially up to date you will
    get some warnings about 'Duplicated column name'. You can safely ignore these!
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    Creating Grant Alter and Index privileges if they don't exists
    You can ignore any Duplicate column errors
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    Adding columns needed by GRANT .. REQUIRE (openssl)
    You can ignore any Duplicate column errors
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    Creating the new table and column privilege tables
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    Changing name of columns_priv.Type -> columns_priv.Column_priv
    You can ignore any Unknown column errors from this
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    Fixing the func table
    You can ignore any Duplicate column errors
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    Adding new fields used by MySQL 4.0.2 to the privilege tables
    You can ignore any Duplicate column errors
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    Waiting for mysql to restart..............finished.
    
    
    /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").
    /usr/sbin/setfiles:  labeling files under /
    matchpathcon_filespec_eval:  hash table stats: 1 elements, 1/65536 buckets used, longest chain length 1
    /usr/sbin/setfiles:  Done.
    Install Complete
    root@server1 [~]# service mysql restart
    No mysqld pid file found. Looked for /var/lib/mysql/server1.domain.com.pid.
    root@server1 [~]# 
     
  4. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Login to server and try the following :-
    cd /var/lib/mysql/
    touch mysql.sock
    chmod 1777 mysql.sock
    chown mysql.mysql mysql.sock

    Create a symlink for the sock file :-
    ln -s /var/lib/mysql/mysql.sock /tmp

    Restart mysql :- service mysql restart

    Also check the url :- http://forums.cpanel.net/showthread.php?t=48890

    If any errors, paste it.
     
  5. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    What is the OS on your cPanel server?
     
  6. mpi

    mpi Well-Known Member

    Joined:
    Mar 29, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    da

    here is the shell window:

    Code:
    root@server1 [~]# cd /var/lib/mysql/
    root@server1 [/var/lib/mysql]# touch mysql.sock
    root@server1 [/var/lib/mysql]# chmod 1777 mysql.sock
    root@server1 [/var/lib/mysql]# chown mysql.mysql mysql.sock
    root@server1 [/var/lib/mysql]# ln -s /var/lib/mysql/mysql.sock /tmp
    root@server1 [/var/lib/mysql]# service mysql restart
    No mysqld pid file found. Looked for /var/lib/mysql/server1.domain.com.pid.
    root@server1 [/var/lib/mysql]# 
    when i ftp /var/lib/mysql/ , i see a file called "server1.domain.com.err" and i see "server1.pid"...notice that there is not ".domain.com."

    so i changed the pid files name properly and the following shoes when i enter the restart command:

    Code:
    Last login: Mon Apr  3 15:57:07 2006 from adsl-69-232-42-238.dsl.irvnca.pacbell.net
    root@server1 [~]# service mysql restart
    Killing mysqld with pid 11880
    /etc/init.d/mysql: line 172: kill: (11880) - No such process
    Wait for mysqld to exit................................. gave up waiting!
    root@server1 [~]# 
    here is what the .err file contains:

    Code:
    060403 00:54:40  mysqld started
    060403  0:54:40 Warning: Asked for 196608 thread stack, but got 126976
    060403  0:54:40  InnoDB: Started
    060403  0:54:40 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    060403  0:54:40 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    060403  0:54:40 Aborting
    
    060403  0:54:40  InnoDB: Starting shutdown...
    060403  0:54:42  InnoDB: Shutdown completed
    060403  0:54:42 /usr/sbin/mysqld: Shutdown Complete
    
    060403 00:54:42  mysqld ended
    
    060403 00:54:43  mysqld started
    060403  0:54:44 Warning: Asked for 196608 thread stack, but got 126976
    060403  0:54:44  InnoDB: Started
    060403  0:54:44 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    060403  0:54:44 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    060403  0:54:44 Aborting
    
    060403  0:54:44  InnoDB: Starting shutdown...
    060403  0:54:46  InnoDB: Shutdown completed
    060403  0:54:46 /usr/sbin/mysqld: Shutdown Complete
    
    060403 00:54:46  mysqld ended
    
    060403 00:54:49  mysqld started
    060403  0:54:49 Warning: Asked for 196608 thread stack, but got 126976
    060403  0:54:49  InnoDB: Started
    060403  0:54:49 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    060403  0:54:49 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    060403  0:54:49 Aborting
    
    060403  0:54:49  InnoDB: Starting shutdown...
    060403  0:54:51  InnoDB: Shutdown completed
    060403  0:54:51 /usr/sbin/mysqld: Shutdown Complete
    
    060403 00:54:51  mysqld ended
    
    060403 00:55:19  mysqld started
    060403  0:55:19 Warning: Asked for 196608 thread stack, but got 126976
    060403  0:55:19  InnoDB: Started
    060403  0:55:19 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    060403  0:55:19 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    060403  0:55:19 Aborting
    
    060403  0:55:19  InnoDB: Starting shutdown...
    060403  0:55:21  InnoDB: Shutdown completed
    060403  0:55:21 /usr/sbin/mysqld: Shutdown Complete
    
    060403 00:55:21  mysqld ended
    
    060403 15:58:25  mysqld started
    060403 15:58:25 Warning: Asked for 196608 thread stack, but got 126976
    060403 15:58:25  InnoDB: Started
    060403 15:58:25 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
    060403 15:58:25 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
    060403 15:58:25 Aborting
    
    060403 15:58:25  InnoDB: Starting shutdown...
    060403 15:58:28  InnoDB: Shutdown completed
    060403 15:58:28 /usr/sbin/mysqld: Shutdown Complete
    
    060403 15:58:28  mysqld ended
    
    
    P.S. OS is fedora core 4.
     
  7. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Can you paste the output of the command :
    Code:
    ]# myisamchk -dvv host.MYI
     
  8. mpi

    mpi Well-Known Member

    Joined:
    Mar 29, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    asd

    root@server1 [~]# myisamchk -dvv host.MYI
    myisamchk: error: File 'host.MYI' doesn't exist
    root@server1 [~]#
     
  9. mpi

    mpi Well-Known Member

    Joined:
    Mar 29, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    cool

    thx guys,

    i got it to work, re-installed mysql and reinstalled apache....tha fixed it.

    cheers.

    P.S. if anyone has this problem, let me know and i'll walk you through it.
     
  10. Secret Agent

    Secret Agent Guest

    I get the access denied error but I am using mysql 5. How do I correct this?
     
  11. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hi everybody
    I have same problem and When I try to do this coomands I see error:
    root@hostname [~]# cd /var/lib/mysql/
    root@hostname [/var/lib/mysql]# touch mysql.sock
    root@hostname [/var/lib/mysql]# chmod 1777 mysql.sock
    root@hostname [/var/lib/mysql]# chown mysql.mysql mysql.sock
    root@hostname [/var/lib/mysql]# ln -s /var/lib/mysql/mysql.sock /tmp
    ln: `/tmp/mysql.sock': File exists

    This is mysql content
    Code:
    root@hostname [/var/lib/mysql]# ls
    ./                         eximstats/                 site1_db/
    ../                        horde/                     Hostname.domain.com.err
    sitex_db/             ib_arch_log_0000000000     Hostname.domain.com.pid
    sitex_db/            ibdata1                           sitex_db/
    sitex_db/             ib_logfile0                sitex_db/
    sitex_db/               ib_logfile1                sitex_db/
    sitex_db/      sitex_db/  sitex_db/
    sitex_db/         sitex_db/              sitex_db/
    sitex_db/               mysql/                     test/
    centos01.domain.com.err  mysql.sock=                tmp/
    centos01.domain.com.pid  sitex_db/           sitex_db/
    sitex_db/           domain-centos01.err
    
    My sql is down on this server please guide me.
     
  12. psycash

    psycash Registered

    Joined:
    Apr 22, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    try this one;
    go mysql folder;
    cd /var/lib/mysql
    and create a file;
    touch yourhostname.pid
    and write this commands;
    chown mysql:mysql yourhostname.pid
    chmod 660 yourhostname.pid
    service mysql restart



    your hostname in the file that;
    cat /etc/hosts

    like example.example.com
     
  13. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks but i got this error:
    Code:
    root@hostname [/var/lib/mysql]# touch example.example.com.pid
    root@hostname [/var/lib/mysql]# chown mysql:mysql example.example.com.pid
    root@hostname [/var/lib/mysql]# chmod 660 example.example.com.pid
    root@hostname [/var/lib/mysql]# service mysql restart
    No mysqld pid file found. Looked for /var/lib/mysql/example.example.com.pid
    

    and I copy the host name from:/etc/hosts for ensure.
     
  14. psycash

    psycash Registered

    Joined:
    Apr 22, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    lets try giving a pid number for mysql;
    pico -w /var/lib/mysql/example.example.com.pid

    add a number like 31765

    ctrl+c and save

    service mysql restart

    cat /var/lib/mysql/example.example.com.pid
    31765
     
  15. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    I cant understand what happening on this server
    when I login and check mysql folder one time there is 1 .pid file
    and when I check again this folder I see 2 .pid file and when I want to check by "cat" it show error ther is no .pid file
    Code:
    root@hostname [/var/lib/mysql]# ls
    ./                         
    ../                        sitex_db/             mysql/
    sitex_db/            mysql.sock=
    sitex_db/             sitex_db/
    sitex_db/               domain-centos01.err
    sitex_db/      sitex_db/
    sitex_db/         [B]hostname.domain.com.pid[/B]
    sitex_db/               hostname.domain.com.err
    centos01.domain.com.err  sitex_db/
    sitex_db/           sitex_db/
    eximstats/                 sitex_db/
    horde/                     sitex_db/
    ib_arch_log_0000000000     sitex_db/
    ibdata1                    test/
    ib_logfile0                tmp/
    ib_logfile1                
    root@hostname [/var/lib/mysql]# ls
    ./                         sitex_db/
    ../                        mysql/
    sitex_db/             mysql.sock=
    sitex_db/            sitex_db/
    sitex_db/             domain-centos01.err
    sitex_db/              sitex_db/
    sitex_db/      [B]hostname.domain.com.pid[/B]
    birjandz_db5for9m/         hostname.domain.com.err
    sitex_db/               [B]hostname.domain.com.pid[/B]
    centos01.domain.com.err  sitex_db/
    sitex_db/           sitex_db/
    eximstats/                 sitex_db/
    horde/                     sitex_db//
    ib_arch_log_0000000000     sitex_db/
    ibdata1                    test/
    ib_logfile0                tmp/
    ib_logfile1                sitex_db/
    sitex_db/
    root@hostname [/var/lib/mysql]# cat /hostname.domain.com.pid
    cat: /hostname.domain.com.pid: No such file or directory
    
     
  16. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    Don't put '/' before the file name if you are in the same directory where the file resides.
     
  17. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    please check it again with me
    Code:
    root@hostname [/var/lib/mysql]# touch mysql.sock
    root@hostname [/var/lib/mysql]# chmod 1777 mysql.sock
    root@hostname [/var/lib/mysql]# chown mysql.mysql mysql.sock
    root@hostname [/var/lib/mysql]# ln -s /var/lib/mysql/mysql.sock /tmp
    ln: `/tmp/mysql.sock': File exists
    root@hostname [/var/lib/mysql]# myisamchk -dvv host.MYI
    myisamchk: error: File 'host.MYI' doesn't exist
    root@hostname [/var/lib/mysql]# touch hostname.com.pid
    root@hostname [/var/lib/mysql]# chown mysql:mysql hostname.com.pid
    root@hostname [/var/lib/mysql]# chmod 660 hostname.com.pid
    chmod: cannot access `hostname.com.pid': No such file or directory
    root@hostname [/var/lib/mysql]# chmod 660 hostname.com.pid
    chmod: cannot access `hostname.com.pid': No such file or directory
    root@hostname [/var/lib/mysql]# chmod 660 hostname.com.pid
    root@hostname [/var/lib/mysql]# service mysql restart
    No mysqld pid file found. Looked for /var/lib/mysql/hostname.com.pid.
    root@hostname [/var/lib/mysql]#
     
    #17 nimon, Apr 23, 2006
    Last edited: Apr 23, 2006
  18. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    please check it again with me
    Code:
    root@hostname [/var/lib/mysql]# touch mysql.sock
    root@hostname [/var/lib/mysql]# chmod 1777 mysql.sock
    root@hostname [/var/lib/mysql]# chown mysql.mysql mysql.sock
    root@hostname [/var/lib/mysql]# ln -s /var/lib/mysql/mysql.sock /tmp
    ln: `/tmp/mysql.sock': File exists
    root@hostname [/var/lib/mysql]# myisamchk -dvv host.MYI
    myisamchk: error: File 'host.MYI' doesn't exist
    root@hostname [/var/lib/mysql]# touch hostname.com.pid
    root@hostname [/var/lib/mysql]# chown mysql:mysql hostname.com.pid
    root@hostname [/var/lib/mysql]# [b]chmod 660 hostname.com.pid[/b]
    chmod: cannot access `hostname.com.pid': No such file or directory
    root@hostname [/var/lib/mysql]# [b]chmod 660 hostname.com.pid[/b]
    chmod: cannot access `hostname.com.pid': No such file or directory
    root@hostname [/var/lib/mysql]# [b]chmod 660 hostname.com.pid[/b]
    root@hostname [/var/lib/mysql]# service mysql restart
    No mysqld pid file found. Looked for /var/lib/mysql/hostname.com.pid.
    root@hostname [/]# cat /var/lib/mysql/hostname.com.pid
    cat: /var/lib/mysql/hostname.com.pid: No such file or directory
    root@hostname [/]#
    look at hostname.com.pid it sometines is avalable and sometimes is not available
    and my.cnf is:
    Code:
    [mysqld]
    set-variable = max_connections=500
    safe-show-database
    my problem is not solved please help me.
     
    #18 nimon, Apr 23, 2006
    Last edited: Apr 23, 2006
  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
    paste the last 20 or so lines of the error log when you try to start mysql
     
  20. nimon

    nimon Member

    Joined:
    Oct 16, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page