2 Replies - 370 Views - Last Post: 14 September 2012 - 04:53 AM Rate Topic: -----

#1 tamunoemi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 14-September 12

error

Posted 14 September 2012 - 02:44 AM

my intention was to password mysql in wampserver2.2e
Whwn I enter the cmd WHERE user='root';
I get syntax error.
Is This A Good Question/Topic? 0
  • +

Replies To: error

#2 KingCuddles  Icon User is offline

  • D.I.C Regular

Reputation: 176
  • View blog
  • Posts: 496
  • Joined: 20-December 08

Re: error

Posted 14 September 2012 - 03:24 AM

Are you trying to change the MySQL root password in WAMP? If so:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;



You will also need to update your phpMyAdmin config files to reflect these changes.
Was This Post Helpful? 0
  • +
  • -

#3 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: error

Posted 14 September 2012 - 04:53 AM

It's generally better to not manually update system tables like that. MySQL has a SET PASSWORD command that basically does the same thing the UPDATE query does.

To change the password for the current user:
SET PASSWORD = PASSWORD('your new password');


Or, if you log in with a root-like user, you can change passwords for any user:
SET PASSWORD FOR 'user'@'host' = PASSWORD('new password');



The FLUSH PRIVILEGES is taken care of as well, so no need to do that manually.

View Posttamunoemi, on 14 September 2012 - 09:44 AM, said:

Whwn I enter the cmd WHERE user='root';
I get syntax error.

We'd need to see the actual syntax, and the actual error, to be able to spot the problem.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1