Error No. 1045 : While trying to connect to MySql - mysql

I installed SQLYog Community edition for windows, a GUI tool for MySql. I had earlier installed MySql with XAMPP. Now when I am trying to connect , I see an error (as pointed):
What could be the reason, I am getting this ? How do I connect to MySql and start using this GUI tool ?

The message says access denied for suhail #localhost . These could be the issues :
The user suhail does not exist at locahost.
The password specified is wrong.
MySql Server is not started. If it is started the port number is not 3306.
These are some of the troubleshoot techniques.
Also follow the comments on your question.

I had exactly same error message, however, it is resolved by means of using admin password on my machine. The message I get is as follows:
Connection info
Connection successful!
MySQL version: 5.1.54-community
Then I clicked ok to continue. See if this works for you!

error 1045 is a common authentication error
The user should be allowed to connect from remote hosts.
It should be defined as 'suhail'#'%' and not 'suhail'#'localhost')
http://webyog.com/faq/content/23/18/en/error-no-1045-connection-denied.html
* User is not allowed to connect from the actual host. Note that MySQL by default only allows connection from 'localhost'. To specify from where a user may connect SQL wildcards (% and _) can be used. Simply 'someuser#%' means that user 'someuser' may connect from everywhere.

I too was having the same problem, but it was solved by giving.. username as- root.
So. try by giving
username: root.

Go to mysql Workbench >> Users and privileges >>
Select user in user accounts tab, then on right side open schema privileges tab >> there you have to give required permissions.
If not work,
open a 3306 port in windows firewall.

Check whether the port is already in use or not. 3306 port is for Mysql server. So check whether it is being used or not. if it is used then we can kill that process and can try again to connect to the same port.

Please try to put the 127.0.0.1 instead of localhost in mysqlhost address
mine is working

Related

Failing to connect to Sequel Pro with '127.0.0.1', but can connect via terminal with 'localhost'

I have a project running on Docker and I'm able to connect to the database through the terminal:
mysql -h localhost -P 33060 --protocol=tcp -u 'notmyrealusername' -p
This works fine and I'm able to show the tables from the database.
However, when trying to connect via SequelPro, I get the following error:
Unable to connect to host 127.0.0.1, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds).
MySQL said: Protocol mismatch; server version = 11, client version = 10
Note that the project is running on MySQL 5.7.34 and the version on my computer is 8.0.23.
OS: Mac OS Catalina
What I have tried:
From this thread, I have tried also with the port of 2200 and, well, SequelPro won't let me use 127.0.0.1. So, I couldn't try the second one.
I have also granted all privileges to both 'notmyrealusername'#'127.0.0.1' and 'notmyrealusername'#'localhost', but that didn't seem to fix it either.
Replying to Philippe's questions:
Yes, If I try mysql -h 127.0.0.1, then I get the same error:
ERROR 2007 (HY000): Protocol mismatch; server version = 11, client
version = 10
Question:
Does anyone know either how to connect to 'localhost' and not '127.0.0.1' on SequelPro or why I can't seem to connect to this database on SequelPro, when, with the same data, I can easily connect via terminal?
Thanks in advance for all of the help/suggestions you can provide!
Thanks!
I have finally found the solution. For anyone wondering, the key here is that I am using Docker. In this case, as outlined in this forum post, we need to:
Use the IP address of the machine where the database is running (the
real one, not localhost) as host address.
How?
Go to your terminal and use the command ifconfig . You'll get a bunch of data, but what you're looking for is the local network IP address. This usually looks like either 192.x.x.x or 10.x.x.x.
Then, in Sequel Pro or whatever GUI you are using, use this address (192....) instead of localhost.
I hope this helps someone and saves you time :)
Happy coding!

Access Denied eror in mySQL

I am creating new connection in mySQL workbench but i gives me access denied error please tell me whats the mistake?
first ,you should you can connect the system server,maybe system port of 3306 was close;
second ,you should you login user_name was allow your ip of now,if db is reliease,refuse local to connect ;
third ,you need surr your password is true.
As the error says the user you used is not allowed to connection. There are usually 2 reasons for this problem (not counting typos):
The user doesn't exist.
The password is wrong.
Keep in mind that MySQL allows to specify a host from where a user can connect. That means firza#localhost, firza#127.0.0.1 and firza#% are 3 different users!

dbeaver mysql access denied

Can anyone tell me why I got an alert with the access denied error?
I tried to create a mysql database and I confidently sure I entered the correct password for root yet I still got this error.
However, based on the mysql documentation for troubleshooting, my error specified that I did not enter the correct password which in fact I did not.
Mysql documentation
https://dev.mysql.com/doc/refman/5.5/en/problems-connecting.html
Also , I tried to run this command sudo mysql -u root -pand it also show me the same error.
P.S Because my reputation is too low, I can't attach the full image.
might be check you are currently connect with the correct password plugin, use the following Command,
SELECT user, authentication_string, plugin, host FROM mysql.user;
If your are login with root, check whether plugin is "mysql_native_password" if not, change as it is with the following command.
ALTER USER 'root'#'localhost IDENTIFIED WITH mysql_native_password BY 'Password#123'
You may get this error when your mysqld is configured to accept connection only from localhost.
In such case, you need to modify bind-address property in /etc/mysql/mysql.conf.d/mysqld.cnf. You can allow only your ip or from the whole internet(0.0.0.0).
Make sure to restart the mysql server.
sudo systemctl restart mysql.
That's not it. You also need to allow connection on port 3306 using commands like ufw or iptables.
I had this problem on Beekeeper and DBeaver. It was driving me INSANE. I literally copied the password and was testing the connections manually and it was working perfectly. Annoyingly this server was working perfectly with MySQL workbench on Windows before I migrated over to Fedora.
So I needed to set the "SSH" section so that it would log me in to the other device. That test connection worked perfectly. But STILL no success. "Password failure" an incredibly inaccurate error message...
Turns out after enabling the SSH connection I forgot to change the "Server host" variable from it's IP (192...) to 'localhost'. Now it works perfectly.
It Could be various things try this:
In main configuration username="root" password="YOUR_PASSWORD" As in no need to put the actual password, only copy "YOUR_PASSWORD"
If it still doesn´t work leave the database bank
Check that your IP address is added to the server permissions/security
Check that the DB is available and that public connection is allowed
If using Windows allow connections to the port 3306 on the Firewall Defender(control panel, security, firewall defender, advanced setting, add inbound rule, port, 3306, allow)
For anyone struggling with SSH tunnel. I found that sometimes 127.0.0.1 is not being translated back to localhost before privileges are being check.
Try setting up a grant for 127.0.0.1 with the following.
GRANT ALL PRIVILEGES ON *.* TO 'user'#`127.0.0.1`;
This did the trick for me.
Please enter these configurations in connection window

Can't connect to MySQL

I'm trying to connect to MySQL, using Sequel Pro, something I have done many times before. Host 127.0.0.1, username root, no password. I get the following message:
Unable to connect to host 127.0.0.1 because access was denied.
Double-check your username and password and ensure that access from your current location is permitted.
MySQL said: Access denied for user 'root'#'localhost' (using password: NO)
For what it's worth, I got this message after upgrading to a new Mac OS (Mavericks), realized that the server wasn't running, downloaded a new server (which is currently running), and tried again - but I had the same problem.
Make sure you are running MySql in background System Preferences -> Mysql -> Start MySql
Make sure you are able to connect to MySql through command line, if command line works, there is no reason why it should not work in SequelPro.
If problem still persists, try changing the 'root' password.
It happened to my in Mac. I went to system preferences -> MySQL -> Stopped the server, started it again, and it worked.

phpmyadmin is denying me access when I try and use it through http://localhost/xampp homepage

I am using a mac laptop running mac os x version 10.5.8 and I need to export a database to an .sql file so I can push it to github for a project. However when I attempt to use phpmyadmin for this through the localhost homepage, when I click on the link it responds with a page with just this error message:
MySQL said:
1045 - Access denied for user 'root'#'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
But it doesn't even prompt you for user information to begin with? is there something I am missing? someone please help
The problem is in your phpmyadmin configuration on the server.
You can see the documentation here: http://www.phpmyadmin.net/documentation/#setup_script
The setting you are looking for is "$cfg['Servers'][$i]['auth_type']" - set this to 'HTTP', and you will be able to input a username and password.
To resolve the above error:-
a) Open Mysql console from the tray of WAMP server
b) It will ask for password(you might have set this password earlier when u installed MySql in your system)(In my case it is admin)
c) Enter admin (press enter)
Now it means your phpmyadmin is assuming no password for your MySql and unable to connect MySql but yor are able to connect your MySql Server by providing password
For this Open config.inc file from the below path
C:\wamp\apps\phpmyadmin4.1.14
And replace this line
$cfg['Servers'][$i]['password'] =’ ’;
to `$cfg['Servers'][$i]['password'] = 'admin';
I hope it will work..
Turn off your Firewall and then connect to phpmyadmin. It should open. Then turn on Firewall again. Worked for me.