I was trying to connect to MySQL database on a remote server from the command line.
mysql --host=<host name> --user=<username> --password=<password> <db name>
I have no issue with connecting to the db from the PHP source but I encountered this error while trying to connect from command line. I connected with exactly same username and password.
ERROR 1045 (28000): Access denied for user '<username>'#'<host IP address>' (using password: YES)
I am not sure which went wrong.
Related
I want to configure a MySQL server for a wordpress.org project on Windows. However, I can't seem to connect to the MySQL server via MySQL shell.
when I inputted the command \connect root#localhost, and entered the password, I got an error:
MySQL Error 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I assumed that I had forgot my password, and tried saving a txt file with the command
ALTER USER 'root'#'localhost' IDENTIFIED BY 'password';
Yet I got the same error message. I then reset the password with mysqld --skip -grant, and when I restarted MySQL and tried to use \connect, I got the error
MySQL Error 1045: Access denied for user 'root'#'localhost' (using password: NO)
I also tried mysql -u root -p, but got the error
ERROR: Not connected.
Basically everything that didn't start with \ generated a Not Connected error.
I tried using the Command Prompt instead of the MySQL shell, but got the exact same error.
How can I properly access MySQL?
I need help. When Checking mySQL version I get this error. I do not use mysql a lot and I am trying to set up a Magento store through command line. However, first I am trying to set up mySql from the database. I am using Mac OS Catalina and Zsh terminal.
Error.
mysql -v
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I know it must be something with my database but I am confused. Any help would be appreciated. When I try to download Magento 2 setup install I get this similar error.
--db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=user#example.com --admin-user=admin --admin-password=123123q --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: NO)
In InstallCommand.php line 264:
Parameter validation failed
EDIT: However, When I connect to mysql -u root I can connect to the database no problem.
You need to pass in the user and password when running mysql from the command line
mysql -u root -p
[enter password]
Alternatively, you can set up a mylogin.cnf (or a .my.cnf) to save the user/password as a file, so you don't need to remember it.
https://dba.stackexchange.com/questions/86595/how-can-i-make-mysql-client-read-password-from-mylogin-cnf
I have installed 8.0.18 MySQL Community Server - GPL.
1. When I tried "sudo mysql" in terminal it is giving the following error.
"ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)".
Need to connect from Workbench
The MySQL server is up and running.
Giving the following error when trying to connect from workbench
Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found
when i ran this command "mysql -u root -p" it is showing MySQL console. Still not able to connect from Workbench
My problem is below:
C:\Users\ordek> mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root -p
Enter password: ****
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: YES)
I tried lots of solutions before asking here. I've even tried reinstalling MySQL but surprisingly this problem still exists. In Workbench I can't connect to any connection. I always login to the MySQL server as superuser and subsequent attempts to change privileges didn't work because I can't log into MySQL in the usual ways.
In Workbench it doesn't matter which user: root or not, you'll get this message.
[Window Title]
MySQL Workbench
[Main Instruction]
Cannot Connect to Database Server
[Content]
Your connection attempt failed for user 'user1' to the MySQL server at
127.0.0.1:3306:
Access denied for user 'user1'#'localhost' (using password: YES)
Please:
1 Check that MySQL is running on address 127.0.0.1
2 Check that MySQL is reachable on port 3306 (note: 3306 is the default,
but this can be changed)
3 Check the user user1 has rights to connect to 127.0.0.1 from your
address (MySQL rights define what clients can connect to the server and
from which machines)
4 Make sure you are both providing a password if needed and using the
correct password for 127.0.0.1 connecting from the host address you're
connecting from
In "test connection"(WORKBENCH) I always get this message:
[Window Title]
MySQL Workbench
[Main Instruction]
Failed to Connect to MySQL at 127.0.0.1:3306 with user user1
[Content]
Access denied for user 'user1'#'localhost' (using password: YES)
In my mind this is a problem with privileges, but I don't know what to do because I'm a beginner at MySQL. If you know how to overcome this problem, please let me know.
I believe you installed MySQL (windows) using .msi package. As it .msi allows you to do the installation step by step and you can set "root" password.
If you have root password, make sure MySQL services are started.
Control panel > services > Mysql
The user ordek seems unknown to mysql . Switch to root user and it will work .
If this is not possible , or the root password is unknown , re-install mysql , make a note of the root password for future use , create the ordek user and assign it the access rights it needs .
I'm trying to connect to external mysql server through linux command line.
Whe I try for example:
mysql -h 102.235.10.77 -u root -p password
it gives the next error:
ERROR 1045 (28000): Access denied for user 'root'#'190.201.179.249' (using password: NO)
Where 190.201.179.249 How you can see isn't the external server IP if not my local IP.
I already check out external connections at MySQL Server and 3306 port too, it Seems it's a local problem as if I can't connect to another IP than localhost.
regards.