Find the answer to your Linux question:
Results 1 to 6 of 6
Hi folks, CentOS 4.4 amd64 I have been stuck on creating root password; # mysqladmin -u root password yourrootsqlpassword Code: Access denied for user ‘root’@'localhost’ (using password: NO) # su ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787

    mysql - problem on creating root password


    Hi folks,

    CentOS 4.4 amd64

    I have been stuck on creating root password;

    # mysqladmin -u root password yourrootsqlpassword
    Code:
    Access denied for user ‘root’@'localhost’ (using password: NO)
    # su -
    did not help.

    Pls advise how to locate mysql’s hostname.pid file?

    Then to run;
    # kill `cat /mysql-data-directory/host_name.pid`
    mysqld_safe –skip-grant-tables &
    mysqladmin -u root flush-privileges password “newpassword”

    OR is there any other way to fix this problem. TIA


    B.R.
    satimis

  2. #2
    Linux Newbie harner's Avatar
    Join Date
    Jun 2004
    Location
    PA, USA
    Posts
    209
    I don't know much about MySQL, but when I do work with it (which is a lot lately), I use Webmin to do everything. It's not as fast as the command line, but it's simple and gets the job done.

    http://webmin.com/

    I'm sure someone else can help you out, though. I'm simply recommending this product.

    Best of luck
    I praise Webmin and PuTTy!
    Registered Linux User: 439431

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Location
    DC
    Posts
    13
    Did you search for mysqld.pid or your hostname.pid? Mine is located under /var/run/mysqld/mysqld.pid.


    Quote Originally Posted by satimis
    Hi folks,

    CentOS 4.4 amd64

    I have been stuck on creating root password;

    # mysqladmin -u root password yourrootsqlpassword
    Code:
    Access denied for user ‘root’@'localhost’ (using password: NO)
    # su -
    did not help.

    Pls advise how to locate mysql’s hostname.pid file?

    Then to run;
    # kill `cat /mysql-data-directory/host_name.pid`
    mysqld_safe –skip-grant-tables &
    mysqladmin -u root flush-privileges password “newpassword”

    OR is there any other way to fix this problem. TIA


    B.R.
    satimis

  4. #4
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787
    Quote Originally Posted by zildjian1979
    Did you search for mysqld.pid or your hostname.pid? Mine is located under /var/run/mysqld/mysqld.pid.
    Hi zildjian1979,

    I found it, same as yours.


    Previously I made a mistake leaving out "--" before password.

    Tried again;

    [root@server ~]# mysqladmin -u root --password mypassword
    Code:
    Enter password:
    Typing either "mypassword" or "YES" prompted;
    Code:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    Still failed


    satimis
    # mysqladmin -u root password yourrootsqlpassword

  5. #5
    Just Joined!
    Join Date
    Mar 2007
    Posts
    42
    Let's check it .
    First, Is the MySQL data dir is own by mysql group mysql( ex : /usr/local/mysql/data )
    Code:
    # ls -ltr /usr/local/mysql/data
    Then, kill all the mysql process... And start it again with option --user=mysql...
    Code:
    mysqld_safe --user=mysql &
    Then change mysql root password
    Code:
    mysqladmin -u root password 'new_password'

  6. #6
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,787
    Quote Originally Posted by jin_1644
    Let's check it .
    First, Is the MySQL data dir is own by mysql group mysql( ex : /usr/local/mysql/data )
    Code:
    # ls -ltr /usr/local/mysql/data
    # find / -name data
    Code:
    /var/named/data
    /var/named/chroot/var/named/data
    /usr/share/icons/gnome/16x16/stock/data
    /usr/share/icons/hicolor/24x24/stock/data
    /usr/share/icons/hicolor/48x48/stock/data
    /usr/share/icons/hicolor/32x32/stock/data
    /usr/share/icons/hicolor/16x16/stock/data
    /usr/share/cups/data
    /usr/share/pear/data
    /usr/lib64/python2.3/site-packages/Ft/Share/Demos/BuyerBase/data
    /usr/lib64/python2.3/email/test/data
    # find / -name mysql -type d
    Code:
    /var/lib/mysql
    /var/lib/mysql/mysql
    /usr/lib/mysql
    /usr/include/mysql
    /usr/share/mysql
    /usr/lib64/mysql
    /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/DBD/mysql
    /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/auto/DBD/mysql
    No mysql directory on /user/local


    B.R.
    satimis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •