reset/change mysql root password

一世执手 提交于 2019-12-09 03:51:02

问题


How to reset/change mysql root password in bitnami wamp stack?

I trying this solution but this not working for me. In the bitnami folder no have file \bin\mysqld-nt.exe


回答1:


resolve the problem:

1. stop service wampstackMySQL (From the Start menu, select Control Panel, then Administrative Tools, then Services)

1. in windows cmd code:

E:\Bitnami\wampstack-5.4.34-0\mysql\bin\mysqld.exe --defaults-file=E:\Bitnami\wampstack-5.4.34-0/mysql\my.ini wampstackMySQL --init-file=E:\mysql-init.txt

mysql-init.txt code:

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

2. connect to mysql server via workbench with new root password

3. restart PC or restart service wampstackMySQL

4. delete file mysql-init.txt




回答2:


ankichan@ankichan-HP-Notebook:~$ mysql -u root -p
Enter password: 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Then do the following steps:
    Execute bash as root
    sudo bash
    Enter the regular password of your user
    Change root password using:
    passwd root

This will allow you to set a root password eg.

ankichan@ankichan-HP-Notebook:~$ sudo bash
[sudo] password for ankichan: 
root@ankichan-HP-Notebook:~# passwd root
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

root@ankichan-HP-Notebook:~# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13


来源:https://stackoverflow.com/questions/28341788/reset-change-mysql-root-password

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!