MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2012, 09:26 AM
EgamiRorrim EgamiRorrim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 1 EgamiRorrim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 56 sec
Reputation Power: 0
Changing the root password

I have a wiki server set up using mysql, and the root password is blank (just need to press Enter/Return when prompted for the password). I would like to change the root password to something else, but to no avail. I was able to find some websites with some instructions on how to accomplish this, but I cannot get any of them to work. For example, one common way is the mysql command to set the root password:

Code:
mysqladmin -u root password NEWPASSWORD 


So I try this command, but I get an error (note, a1b2 is not the password I am going to use):

Code:
csapp@wiki[~]->mysqladmin -u root password a1b2 
mysqladmin: connect to server at 'localhost' failed 
error: 'Access denied for user 'root'@'localhost' (using password: NO)' 


I then try another mysqladmin command (one that changes the old password to a new one). The format for this command is the following:

Code:
mysqladmin -u root -p'oldpassword' password newpass 


However, this also gave me an error:

Code:
csapp@wiki[~]->mysqladmin -u root -p'' password '123abc' 
Enter password: 
mysqladmin: connect to server at 'localhost' failed 
error: 'Access denied for user 'root'@'localhost' (using password: YES)' 


I then try to just use mysql commands to change the password. However, one common command I find is the following:

Code:
use mysql; 


I know that the "use" command switches databases; however, when I display the databases (using the "show database" command), this is what is returned:
Code:
+----------+ 
| Database | 
+----------+ 
| test | 
| wikidb | 
+----------+ 


Regardless, I try the "use mysql" command, but this is the error I get:

Code:
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'mysql' 


I figured that I was just supposed to use the "wikidb" database, so I execute "use wikidb" which executes fine. I then use the mysql command to set user passwords:

Code:
update user set password=PASSWORD("NEWPASSWORD") where User='root'; 


However, when I execute it, I have to type it in like this:

Code:
UPDATE user SET user_password=PASSWORD('NEW_PASSWORD') WHERE user_name ='root'; 


So I execute that (while replacing the NEW_PASSWORD with the password I want), but this is what is returned:

Code:
Query OK, 0 rows affected (0.00 sec) 
Rows matched: 0 Changed: 0 Warnings: 0 


I know this means that nothing was changed, so I check the list of users for wikidb.user, and I notice that there is not a user called "root" (there is one called WikiSysop, but I don't think those two are the same). Can someone help me out? Also, just some minor notes, I cannot execute "flush privileges" because it gives me this error:

Code:
ERROR 1227 (HY000): Access denied; you need the RELOAD privilege for this operation 


However, when I execute the "show grants" command, this is returned:

Code:
+--------------------------------------------------+ 
| Grants for root@% | 
+--------------------------------------------------+ 
| GRANT USAGE ON *.* TO 'root'@'%' | 
| GRANT ALL PRIVILEGES ON `wikidb`.* TO 'root'@'%' | 
+--------------------------------------------------+ 


I checked, and I I am the root user, so doesn't this mean I should have the RELOAD privilege?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Changing the root password

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap