Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2006
    Posts
    63

    Unanswered: Lost of mysql root password

    Hi folks,


    Ubuntu 7.04 server amd64
    mysql-server 5.0.38
    mysql-admin 1.2.5rc-1
    mysql-admin-common 1.2.5rc-1
    mysql-client 5.0.38
    libmysqlclient15-dev 5.0.38


    $ sudo mysql -u root mysql
    Code:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    Please advise how to recreate new mysql root password w/o the old password? TIA


    B.R.
    satimis
    Last edited by satimis; 12-06-07 at 09:08.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Everything you need is in the manual

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jun 2006
    Posts
    63
    Quote Originally Posted by shammat
    Everything you need is in the manual
    Thanks for your advice.


    # kill `cat /var/run/mysqld/mysqld.pid`
    No complaint

    # SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mysqlpassword');
    Code:
    bash: syntax error near unexpected token `('
    # SET PASSWORD FOR 'root'@'localhost' = PASSWORD'mysqlroot';
    Code:
    bash: SET: command not found
    # which set
    # which SET
    both w/o printout.


    Pls advise which package I need to install to have this bash command 'SET'? TIA


    B.R.
    satimis

  5. #5
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by satimis
    Pls advise which package I need to install to have this bash command 'SET'?
    Read the manual carefully:
    Quote Originally Posted by Manual
    Create a text file and place the following command within it on a single line

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by shammat
    Read the manual carefully:
    heh, RTFMC
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Jan 2008
    Location
    Kingdom of Sweden
    Posts
    11
    shell> echo "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');" > /etc/mysql-init
    shell> sudo mysqld_safe --init-file=/etc/mysql-init &

Posting Permissions

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