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

Discussion in 'General Discussion' started by adnan_00_01, Jun 5, 2006.

  1. adnan_00_01

    adnan_00_01 Member

    Joined:
    May 12, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    When I try to restart mySQL services via WHM I got following error:

    Main >> Restart Services >> SQL Server (MySQL)

    Attempting to restart mysql
    Waiting for mysql to restart.... . . . . . . . . . . finished.

    mysql statusroot 25125 0.0 0.1 2300 1120 ? S 14:55 0:00

    /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.pid
    mysql 25146 0.7 1.4 105688 13948 ? Sl 14:55 0:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/localhost.pid --skip-locking


    /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)' mysql has failed, please contact the sysadmin (result was "mysql has failed").

    Can anyone help me please?
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    You could try resetting the MySQL root password from WHM.
     
  3. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Can you try resetting the mysql root password from the shell to see if that helps.

    if not try

    /scripts/mysqlup --force
     
  4. adnan_00_01

    adnan_00_01 Member

    Joined:
    May 12, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thank you guys for replay,
    I tried to reset password via WHM but I got the same error.

    but when I tried /scripts/mysqlup --force
    I got following:


    Loaded cPPkgs::MySQL ok!
    This is the cPPkgs::MySQL 4.1.19 installer for Linux.
    Preparing... ########################################### [100%]
    1:MySQL-shared ########################################### [100%]
    Preparing... ########################################### [100%]
    1:MySQL-devel ########################################### [100%]
    Preparing... ########################################### [100%]
    1:MySQL-embedded ########################################### [100%]
    Preparing... ########################################### [100%]
    1:MySQL-client ########################################### [100%]
    Preparing... ########################################### [100%]
    1:MySQL-bench ########################################### [100%]
    Preparing... ########################################### [100%]
    Giving mysqld a couple of seconds to exit nicely
    1:MySQL-server ########################################### [100%]
    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 serv.fdcservers.net 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!

    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 http://shop.mysql.com
    Starting MySQL[ OK ]
    Preparing... ########################################### [100%]
    1:MySQL-shared ########################################### [100%]
    /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.
    Method: Perl Expect
    Testing connection speed...(this could take a while)...Done
    Ping:18.628 Testing mirror speed and update status (cpan-2.mirrors.nks.net) using wget...(2460000 bytes/s)...Done
    Ping:0.677 Testing mirror speed and update status (ftp.osuosl.org) using wget...(5030000 bytes/s)...Done
    Ping:3.164 Testing mirror speed and update status (cpan.uchicago.edu) using wget...(323980 bytes/s)...Done
    Three usable mirrors located
    Mirror Check passed for ftp.osuosl.org (/index.html)
    commit: wrote '/usr/lib/perl5/5.8.7/CPAN/Config.pm'
    CPAN: File::HomeDir loaded ok
    CPAN: Storable loaded ok
    Going to read /home/.cpan/Metadata
    Database was generated on Mon, 05 Jun 2006 02:28:16 GMT
    Running install for module DBD::mysql
    Running make for C/CA/CAPTTOFU/DBD-mysql-3.0004.tar.gz
    CPAN: Digest::SHA loaded ok
    CPAN: Module::Signature loaded ok
    WARNING: This key is not certified with a trusted signature!
    Primary key fingerprint: 2E66 557A B97C 19C7 91AF 8E20 328D A867 450F 89EC
    Signature for /home/.cpan/sources/authors/id/C/CA/CAPTTOFU/CHECKSUMS ok
    CPAN: Compress::Zlib loaded ok
    Checksum for /home/.cpan/sources/authors/id/C/CA/CAPTTOFU/DBD-mysql-3.0004.tar.gz ok
    Scanning cache /home/.cpan/build for sizes
    DBD-mysql-3.0004/
    DBD-mysql-3.0004/ChangeLog
    DBD-mysql-3.0004/constants.h
    DBD-mysql-3.0004/dbdimp.c
    DBD-mysql-3.0004/dbdimp.h
    DBD-mysql-3.0004/INSTALL.html
    DBD-mysql-3.0004/lib/
    DBD-mysql-3.0004/lib/Bundle/
    DBD-mysql-3.0004/lib/Bundle/DBD/
    DBD-mysql-3.0004/lib/Bundle/DBD/mysql.pm
    DBD-mysql-3.0004/lib/DBD/
    DBD-mysql-3.0004/lib/DBD/mysql/
    DBD-mysql-3.0004/lib/DBD/mysql/GetInfo.pm
    DBD-mysql-3.0004/lib/DBD/mysql/INSTALL.pod
    DBD-mysql-3.0004/lib/DBD/mysql.pm
    DBD-mysql-3.0004/lib/Mysql/
    DBD-mysql-3.0004/lib/Mysql/Statement.pm
    DBD-mysql-3.0004/lib/Mysql.pm
    DBD-mysql-3.0004/Makefile.PL
    DBD-mysql-3.0004/Makefile.PL.embedded
    DBD-mysql-3.0004/MANIFEST
    DBD-mysql-3.0004/MANIFEST.SKIP
    DBD-mysql-3.0004/META.yml
    DBD-mysql-3.0004/myld
    DBD-mysql-3.0004/mysql.xs
    DBD-mysql-3.0004/README
    DBD-mysql-3.0004/t/
    DBD-mysql-3.0004/t/00base.t
    DBD-mysql-3.0004/t/10dsnlist.t
    DBD-mysql-3.0004/t/20createdrop.t
    DBD-mysql-3.0004/t/30insertfetch.t
    DBD-mysql-3.0004/t/35limit.t
    DBD-mysql-3.0004/t/35prepare.t
    DBD-mysql-3.0004/t/40bindparam.t
    DBD-mysql-3.0004/t/40blobs.t
    DBD-mysql-3.0004/t/40listfields.t
    DBD-mysql-3.0004/t/40nulls.t
    DBD-mysql-3.0004/t/40numrows.t
    DBD-mysql-3.0004/t/41bindparam.t
    DBD-mysql-3.0004/t/41blobs_prepare.t
    DBD-mysql-3.0004/t/42bindparam.t
    DBD-mysql-3.0004/t/50chopblanks.t
    DBD-mysql-3.0004/t/50commit.t
    DBD-mysql-3.0004/t/60leaks.t
    DBD-mysql-3.0004/t/dbdadmin.t
    DBD-mysql-3.0004/t/insertid.t
    DBD-mysql-3.0004/t/lib.pl
    DBD-mysql-3.0004/t/mysql.dbtest
    DBD-mysql-3.0004/t/param_values.t
    DBD-mysql-3.0004/t/._prepare_noerror.t
    DBD-mysql-3.0004/t/prepare_noerror.t
    DBD-mysql-3.0004/t/texecute.t
    DBD-mysql-3.0004/TODO
    Removing previously used /home/.cpan/build/DBD-mysql-3.0004
    Package came without SIGNATURE


    CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-3.0004.tar.gz

    I will use the following settings for compiling and testing:

    cflags (mysql_config) = -I/usr/include/mysql -g -march=i386 -mcpu=i686
    embedded (mysql_config) =
    libs (mysql_config) = -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
    mysql_config (guessed ) = mysql_config
    nocatchstderr (default ) = 0
    nofoundrows (default ) = 0
    ssl (guessed ) = 0
    testdb (default ) = test
    testhost (default ) =
    testpassword (default ) =
    testsocket (default ) =
    testuser (default ) =

    To change these settings, see 'perl Makefile.PL --help' and
    'perldoc INSTALL'.








    Checking if your kit is complete...
    Looks good
    Using DBI 1.50 (for perl 5.008007 on i686-linux) installed in /usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/
    Writing Makefile for DBD::mysql
    CPAN: YAML loaded ok
    cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
    cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
    cp lib/Mysql.pm blib/lib/Mysql.pm
    cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
    cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
    cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
    cc -c -I/usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/ -I/usr/include/mysql -g -march=i386 -mcpu=i686 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -DVERSION=\"3.0004\" -DXS_VERSION=\"3.0004\" -fpic "-I/usr/lib/perl5/5.8.7/i686-linux/CORE" dbdimp.c
    `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
    /usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI//Driver.xst > mysql.xsi
    /usr/bin/perl /usr/lib/perl5/5.8.7/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.7/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
    Warning: duplicate function definition 'do' detected in mysql.xs, line 224
    Warning: duplicate function definition 'rows' detected in mysql.xs, line 559
    cc -c -I/usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/ -I/usr/include/mysql -g -march=i386 -mcpu=i686 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -DVERSION=\"3.0004\" -DXS_VERSION=\"3.0004\" -fpic "-I/usr/lib/perl5/5.8.7/i686-linux/CORE" mysql.c
    `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
    Running Mkbootstrap for DBD::mysql ()
    chmod 644 mysql.bs
    rm -f blib/arch/auto/DBD/mysql/mysql.so
    LD_RUN_PATH="/usr/lib/mysql" /usr/bin/perl myld cc -shared -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
    chmod 755 blib/arch/auto/DBD/mysql/mysql.so
    cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
    chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
    Manifying blib/man3/DBD::mysql.3
    Manifying blib/man3/DBD::mysql::INSTALL.3
    Manifying blib/man3/Mysql.3
    Manifying blib/man3/Bundle::DBD::mysql.3
    /usr/bin/make -- OK
    Running make install
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Writing /usr/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBD/mysql/.packlist
    Appending installation info to /usr/lib/perl5/5.8.7/i686-linux/perllocal.pod
    /usr/bin/make install UNINST=1 -- OK
    perlmod--Install done
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    Unable to reset root MySQL password. at /scripts/securemysql line 150.
    Install Complete
     
  5. aby

    aby Well-Known Member

    Joined:
    May 31, 2005
    Messages:
    638
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    Did you try resetting the mysql password from the shell ?
     
  6. adnan_00_01

    adnan_00_01 Member

    Joined:
    May 12, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    yes but I got following

    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
     
  7. pravin

    pravin Member

    Joined:
    Jun 8, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    You can use following method to reset the password for mysql root user.

    You will get the password for mysql root user under /root/.my.cnf
    #cat /root/.my.cnf
    e.g
    root@host[/]# cat /root/.my.cnf
    [client]
    user="root"
    pass="modernbill99"
    root@host [/]#

    Please follow following steps to reset the root password.

    #service mysqld stop
    #killall -9 mysqld
    #safe_mysqld --skip-grant-tables & *// it will start mysql in safe mode in background. \\*
    <hit Entre Key>
    root@host [/]#mysql
    mysql>FLUSH PRIVILEGES;
    mysql>GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'modernbill99' WITH GRANT OPTION;
    mysql>FLUSH PRIVILEGES;
    mysql>\q
    root@host [/]# service mysql stop
    root@host [/]# service mysql start.

    Thats all.

    Regards,
    Pravin,
    pravin@etechsupport.net
    http://eTechSupport.net
     
    #7 pravin, Jun 6, 2006
    Last edited: Jun 6, 2006
  8. MMarko

    MMarko Well-Known Member

    Joined:
    Apr 18, 2005
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    16
Loading...

Share This Page