You may receive an error that says MySQL 1045 is denied access. There are several steps you can take to fix this problem, so we’ll cover that a bit later.

g.After creating a local WAMP server and needing access to your phpMyAdmin, an error message is displayed: # 1045 Access denied for user ‘root’ @ ‘localhost’ (with password: YES). This can happen if the root @ localhost MySQL personal database user does not necessarily have the necessary permissions to access my database.

 

 

g.

If multiple matches are possible, this server should determine which ands People use. Solves this awesome problem as follows: (…)

  • When a customer tries to log in, the server looks like [mysql.user] loop-throughs in sorted order.
  • Hosting first uses a string containing the client’s hostname and the person’s name.

(…) The server uses selection rules that first place the rows containing the most host-specific values. Literal host names [eg localhost] and even IP are very specific addresses.

Therefore, such an anonymous user must “hide” any other user, such as '[any_username]' @ '%' , when coming from localhost .

1045 mysql access denied

The recommended solution is to opt out of this anonymous carrier (which is generally a good thing, so you can still do it).

The following changes are often irrelevant to the main question. They are only intended to answer questions that have been asked in other comments in our thread.

root @ myhost: /home/mysql-5.5.16-linux2.6-x86_64# ./mysql -ubill -ppass –socket = /tmp/mysql-5.5.sock Welcome to check out MySQL (…) mysql> user, click the FROM node mysql.user; + —— + ———– + | Internet users | Host | + —— + ———– + | Cost | % | | Root | 127.0.0.1 | | Heart | :: 1 | | the most important thing | localhost | + —— + ———– + 9 rows per set (0.00 sec.) mysql> SELECT USER (), CURRENT_USER (); + —————- + —————- + | USER () | CURRENT_USER () | + —————- + —————- + | invoice @ localhost | Invoice @% | + —————- + —————- + Line 1 in sentence (0.02 sec.) mysql> SHOW VARIABLES AS ‘skip_networking’; + —————– + ——- + Variable name | | Value | + —————– + ——- + | skip_networking | A | + —————– + ——- + 1 line of detail (0.00 sec.)

Exactly the same configuration, except that I re-enabled ads and now create a strong anonymous user '' @ 'localhost' .

root @ myhost: /home/mysql-5.5.16-linux2.6-x86_64#. / mysql Welcome to MySQL Keep (…) mysql> USER ID ” @ ‘localhost’ BY ‘anotherpass’; Request OK, 0 lines changed (0.00 sec.) mysql> goodbye Root @ myhost: / home / mysql-5 .5.16-linux2.6-x86_64 # ./mysql -ubill -ppass n –socket = / tmp / mysql-5.5.sock ERROR 1045 (28000): access denied for user (with change ‘bill’ @ ‘localhost’: YES) root @ myhost: /home/mysql-5.5.16-linux2.6-x86_64# ./mysql -ubill -ppass n -h127.0.0.1 –protocol = TCP ERROR 1045 (28000): Access denied for user “bill” @ “localhost” (with password: YES) root @ myhost: /home/mysql-5.5.16-linux2.6-x86_64# ./mysql -ubill -ppass n -hlocalhost –protocol = TCP ERROR 1045 (28000): Access denied for attacker “bill” @ “localhost” (with password: YES)

The same situation as when editing Now 2, with the entered password of the anonymous user.

root @ myhost: /home/mysql-5.5.16-linux2.6-x86_64# ./mysql -panotherpass -ubill -hlocalhost Welcome to MySQL Keep (…) mysql> SELECT USER (), current_user (); + —————- + —————- + | USER () | CURRENT_USER () | + —————- + —————- + | invoice @ localhost | @localhost | + —————- + —————- + A set of exercises for 1 row (0.01 sec.)

Output 1 Mod 1: You can authenticate as 'bill' @ '%' over a socket.

Output 2 from Processing 2.5: Connecting via TCP or even a socket does not affect the authentication process (unless it can connect as someone other than 'something' @ 'localhost' , but via a socket, of course).

Output3 or from version 3: although I defined -ubill , I got access as anonymous user. This is usually due to the previously recommended “sorting rules”. Please note that most installations have an actual anonymous user with no password that we know of (and which needs to be backed up / deleted).

 

 

Enter: use MySQL;Hit Enter.Set your MySQL password with the following specific command and replace “EnterYourPasswordHere” with your new password of choice: UPDATE mysql.Hit Enter.Clear the permissions by typing: FLUSH PRIVILEGES;Exit by typing: exit.Hit Enter.

Edit the file / etc / my.Increase the referral attribution tables in [mysqld].Reboot the MySQL server.You should now be able to seriously log into mysql using the following command mysql -u root -p.Executing dump permissions; in the MySQL shell.

Fixed bug 1045 (28000) Access denied for user root @ localhost (with password: YES)? To fix this error, you really need to specify the -p parameter for the password.