If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Lost of mysql root password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-07, 07:53
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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 08:08.
Reply With Quote
  #2 (permalink)  
Old 12-06-07, 09:31
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
Everything you need is in the manual
Reply With Quote
  #3 (permalink)  
Old 12-06-07, 10:02
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 12-06-07, 10:12
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #5 (permalink)  
Old 12-06-07, 10:16
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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
Reply With Quote
  #6 (permalink)  
Old 12-06-07, 10:26
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by shammat
Read the manual carefully:
heh, RTFMC
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 01-19-08, 10:52
by0nder by0nder is offline
Registered User
 
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 &
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On