开发者

mysql userid password change

开发者 https://www.devze.com 2023-01-25 21:35 出处:网络
Am using wamp server,where in my project I ne开发者_运维技巧ed to change the userid and password of mysql.I want to change it to username:-\"root\" password:-\"root123\".How it is possible?you would n

Am using wamp server,where in my project I ne开发者_运维技巧ed to change the userid and password of mysql.I want to change it to username:-"root" password:-"root123".How it is possible?


you would need...

$ mysqladmin -u root -p'oldpassword' password newpass


I'd say the easiest way would be to log into phpMyAdmin and update the values in the data.


Enter to WAMP mysql console and write:

CREATE USER 'root'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;

to remove old user

DROP USER 'olduser'@'localhost';

If you are using WAMP on grahical interface, right click on the system tray WAMP and check MySQL section.


Yes it is possible.

Just run (example under windows):

  • Win + r
  • cmd in the run box, hit enter
  • go to your wamp install dir and look for the mysql bin, eg. "cd C:\wamp\apps\phpMyAdmin-3.3.3"
  • run: mysqladmin -uroot password NEWPASSWORD

and it's done.


Go to MySQL Console and then type this in the following prompt

mysql>update mysql.user SET password=password("newpass");

Press "Enter Key"

mysql>flush privileges;

Press "Enter Key"

Restart MySQL Service.

0

精彩评论

暂无评论...
验证码 换一张
取 消