I’m trying to run WordPress in my Windows desktop and it needs MySQL.
I install everything with Web Platform Installer which is provided by Microsoft. I never set a root password for MySQL and in the final step of installing WordPress, it asks for a MySQL server password.
What is the default password for root (if there is one) and how to change it?
I tried:
mysql -u root password ‘123’
But it shows me:
Access denied for user ‘root@localhost’ (using password:NO)
After this I try:
mysql -u root -p
However, it asks for a password which I don’t have.
Update: as Bozho suggested, I did the following:
I stopped the MySQL Service from Windows services
Opened CMD
Changed the location to c:\program files\mysql\bin
Executed the command below
mysqld –defaults-file=”C:\\program files\\mysql\\mysql server 5.1\\my.ini” –init-files=C:\\root.txt
The command ran with a warning about character set which I mentioned below
I start the MySQL service from Windows services
I write in the command line
mysql -u root -p
EnterPassword: 123 // 123 was the password
The command line shows the following error
Access denied for user ‘root@localhost’ (using password:**YES**)
How do I solve this?
As an admin for this type of error, you have to create a new password to the root user. [root ]# mysql -u root ERROR 1045 (28000): Access denied for user \’root\’@\’localhost\’ (using password:NO)\n\nMysql is running [root ]# service mysqul stop stop the service/daemon, stop doing [askl] stop / wait [spl run] .\n\nstart mysql with no privileges; This option is used to boot up and do not use MySQL\’s privilege system. [root ]# MysQld_safe –skip-grant-tables & .\n\n\n\nThe terminal will now seem to be halting. Let\’s say that, and use new terminal for the next step.\n\nenter the mysql command prompt [root ]# MysQl -u root my squl> .\n\nMysql> set the permission setting of root user ; mysQl; Database resorted to a change in the form of the following: my selection * * from user; Empty set (0.00 sec) truncate table user (Query OK, 0 rows affected by QueryQuery; \’YourNewPassword\’ with grant option; the Row row row affected (0.01 sec); my query query OK (0.0l) my p> flush privileges on *.* to root@@localhost with .\n\n\n\nMysql> grants all privileges on *.* to root@localhost identified by \’\’ with grant option; Query OK, 0 rows affected (0.01 sec)* mySQL> flush privilege; query OK – 0- rows impacted (0.00 sec).\n\nConfirm the results: mysql> select host, user from user; +——–+— — — | | + —–++++ + + | User | — +—||+ + User — – ++ | Localhost | root | *-–->->+ 1 row in set (0.00 sec)\n\nMysql> stops in normal mode. [root ]# kill -KILL [PID of mysQld_safe] [[root]] # Kill –Kill [PILL of MySQLd][[piD] .\n\nThe password you set [root ]# mysql -u root –pYourNewPassword mySQl> allows you to login as root user.