Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 585 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access denied for user 'root@localhost' (using password:NO)

#1
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:

1. I stopped the MySQL Service from Windows services
2. Opened CMD
3. Changed the location to c:\program files\mysql\bin
4. Executed the command below

`mysqld --defaults-file="C:\\program files\\mysql\\mysql server 5.1\\my.ini" --init-files=C:\\root.txt`

5. The command ran with a warning about character set which I mentioned below
6. I start the MySQL service from Windows services
7. I write in the command line

`mysql -u root -p`
`EnterPassword: 123 // 123 was the password`

8. The command line shows the following error

`Access denied for user 'root@localhost' (using password:**YES**)`

How do I solve this?
Reply

#2
You can <a href="http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html">reset your root password</a>. Have in mind that it is not advisable to use root without password.
Reply

#3
mysqladmin -u root -p password

enter your `current` `password`

then

enter your `new password`
Reply

#4
Another solution if someone gets the error *The specified password for user account ‘root’ is not valid, or failed to connect to the database server* also with the right password, is the follow


•In the Windows registry, delete the mysql_pwd reg key under HKCU\Software\Microsoft\WebPlatformInstaller

•Unistall older version of MySQL .NET connector

•Download and install the latest [MySql .NET Connector][1].


[1]:

[To see links please register here]

Reply

#5
Some times it just happens due to installation of Wamp or changing of password options of root user.
One can use privilages-->root (user) and then set password option to NO to run the things without any password OR set the password and use it in the application.
Reply

#6
In your code replace the **'root'** with your Server **username** and password with your server password.
For example if you have DB and your php files on the server

[To see links please register here]

then obviously you would have to enter into this server site using your username and password.
Reply

#7
I was getting the same error on OS X El captain.
Mysql version 5.7 . I was able to connect to mysql with root after executing these steps.

Stop the mysql server

sudo mysql.server stop

Start mysql in safe mode

sudo mysqld_safe --skip-grant-tables

Using mysqld, Change the database to mysql and update the details for user 'root'.

show databases;
use mysql;
UPDATE mysql.user
SET authentication_string = PASSWORD('MyNewPass'), password_expired = 'N'
WHERE User = 'root' AND Host = 'localhost';
exit;

After that kill the 'mysqld_safe' process and start mysql normally. You should be able to login to mysql using root and new password. [SQL docs for more details][1]


[1]:

[To see links please register here]

Reply

#8
For MySQL 5.7. These are the below steps:

Stop your MySQL server completely. This can be done by accessing the Services window inside Windows XP and Windows Server 2003, where you can stop the MySQL service.

Open your MS-DOS command prompt using "cmd" inside the Run window. Inside it navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

Execute the following command in the command prompt: mysqld.exe -u root --skip-grant-tables

Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window.

Navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.

Enter mysql and press enter.

You should now have the MySQL command prompt working. Type use mysql; so that we switch to the "mysql" database.

Execute the following command to update the password:

update user set authentication_string=password('1111') where user='root';
Reply

#9
Simply edit `my.ini` file in C:\xampp\mysql\bin path. Just add:

skip-grant-tables

line in between lines of `# The MySQL server [mysqld]` and `port=3306`. Then restart the MySQL server.

Looks like:

[![Screenshot][1]][1]

[1]:
Reply

#10
If you are using XAMPP just go to `C:\xampp\phpMyAdmin` and then open `config.inc.php` find `$cfg['Servers'][$i]['password'] = ''` line and put your password there.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through