Regarding the first answer to the Question Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'#'localhost'(using password:YES), after step 3, says if connection is denied then type
mysql >GRANT ALL ON [DatabaseName].* TO 'root'#'127.0.0.1' IDENTIFIED BY '[PASSWORD]';
But when i type the following in command prompt of Windows,
C:\Program Files\MySQL\MySQL Server 5.6\bin>GRANT ALL ON MySQL Server 5.6.* TO'root'#'127.0.0.1' IDENTIFIED BY '[password]';
I get the following error.
'GRANT' is not recognized as an internal or external command,operable program or batch file.
Please help as I'm trying to establish the connection between MySQL and the Database.
Related
I've been trying to create a new database connection on workbench. However, every time I test a connection there is an error message that says
Failed to connect to mysql at 127.0.0.1:3306 with user root
unable to connect localhost
finally I get it by installing MySQL installer
I'm creating a backend node server on Windows. I'm using MySQL8.0, and since the beginning, my db root has had a password set. In the middle of working, MySQL Workbench kicked me out of my database connection and I haven't been able to connect since, either on Workbench or in command line. I keep getting the following error:
Your connection attempt failed for user 'root' from your host to server at
127.0.0.1:3306:
Access denied for user 'root'#'localhost' (using password: YES)
Things I've attempted:
Intentionally entering in wrong/different password
RESULT: Before I started fiddling with everything, I got an error related to invalid credentials (ie. not the same as the Access denied). After I did all the following, if the server is running, same "Access denied" error. If the server is not running, "can't connect to server on 'localhost'" error.
mysql -u root -p -h 127.0.0.1 -P 3306
RESULT: Request for password, "Access denied."
mysqld.exe -u root --skip-grant-tables
RESULT: Multiple [Server] "Can't create test file" errors followed by [Server] "Aborting" This is the same whether the server is running or not.
mysql_secure_installation
RESULT: I'm asked for my password. If server is running, get "Access denied" error. If turned off, get "can't connect to server on 'localhost'" error.
Attempted to reinstall mysql as a service
RESULT: I now have two mysql services: MySQL (new) and MySQL80 (original). The issue persists, no matter which is running.
mysqld --skip-grant-tables
mysql -u root -p
RESULT: This doesn't have errors now? Except I'm also requested for a password. Same "Access denied" error.
Followed the instructions to reset my password listed at Mysql's website: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
RESULT: I can finally connect! Except I open up Workbench to find all my databases missing. I realize I have MySQL service running, and not MySQL80. I switch to that. The "Access denied" error is back.
sc remove MySQL
Repeated instructions for resetting password
RESULT: Now only have MySQL80. When using mysql-init.txt to run server, I can log in on Workbench, but all my databases are missing here too. I close out, restart the service manually. Back to "Access denied" error.
My app's node server has had no issue connecting to MySQL80 when it was running, despite all this. It's using a non-root user to login.
I have installed MYSQL 5.6 stand-alone on a local windows server. Recently, I changed the local IP of my server and reconfigured it in my network, but now I am not able to access my databases. It is giving me this error:
1045 - Access denied for user 'user'#'localhost' (using Password: Yes)
The above error is coming while using localhost as the server name. Also, I am able to connect to localhost through root username, but it is not showing me the original DB's which I had before.
Also before the server IP change I was able to access the MySQL server through the old IP of the server. like host name: xx:xx:xx:xx , user: user, pass: pass .... But it is also giving me an error:
2003 - cannot connect to my sql server on 'xx:xx:xx:xx' (10038)
I have tried the solution define on following link and run following query:
https://dev.mysql.com/doc/mysql-windows-excerpt/5.6/en/resetting-permissions-windows.html
SET PASSWORD FOR 'root'#'%' = PASSWORD('test');
and this is starting giving error of access denied for the root username and password 'test'
Can any body help me to resolve this.
Connect to 127.0.0.1 as root.
Update IP address for mysql user row with old IP address.
use mysql;
update user set host='NEWIP' where host='OLDIP' and user='root';
flush privileges;
Try again to connect.
If you don't have root access, reset permissions and try again.
http://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
This is a problem experienced by people who downloaded the recent version (i.e MySQL 5.7.10)
The problem is there is a temporary password for this version
after you typed in bin>mysql -u root -p ...
you have to type in the password which is different for every person who downloaded it. Go to your mysql directory in C (or wherever you extracted it to) , go to the file 'data'. There would be an ERR file with your computer's name on it.
Open that file using notepad
in the 6th line of commands, there would be a line as follows
[Note] A temporary password is generated for root#localhost: '(your password)'
copy that password and paste it in the command prompt ... From there on you can continue as shown in the video
I have one instance of mysql.
It is running at "C:\Program Files\MySQL\MySQL Server 5.5\bin\"
Now, when I try to connect using "heidisql" tool using user name as "root" and password as "eagle" then it connects properly and show the databases which I had created.
Now I open Command Prompt and go to the location where my MySQL service is running, Here I executed the same command but not working like shown below,
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql -uroot -peagle
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
Also, now I closed all the mysql server and then typed
"C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql"
then it connects properly. I am not getting as all my mysql server is off then whom it is connecting to.
I am suspecting some where I have 2 instances of mysql running but I checked ControlPanel, Services running, No where I found any other service.
If any body faced such issue and solved, please suggest me solution.
There can be some root users on the same MySQL server which differ by host, for example - 'root'#'localhost', 'root'#'%', 'root'#'server'. All these users can have different passwords. Check it firstly, and specyfy -h or --host option in your command line.
Also, command line syntax is incorrect, it should be like this -
mysql -u root -peagle
When I try to connect to a remote mysql database I receive an error saying I was unable to log into my router's mysql database.
tom#main:~$ mysql -u appleton -p -h 85.17.xxx.xx
Enter password:
ERROR 1045 (28000): Access denied for user 'appleton'#'85.210.169.xxx' (using password: NO)
Even though I am specifying my IP (85.17.xxx.xx) in the argv the error message is showing my Router's external IP (85.210.169.xxx)
I discovered this whilst using DBI->connect in perl.
Am I missing something obvious?
'appleton'#'85.210.169.xxx' is supposed to show your host, not the database's host. It's your full identifier (username#host) for mysql to determine if you are allowed to connect. Do you have sufficient rights to connect to the database from your IP? Access can be granted to users so that they can only connect from localhost for example.
MySQL Docs on Users