问题
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