When I try to start MySQL via the commandline
shell> mysql
when WAMP is not on (not offline, but simply not starting WAMP at all), I am able to access MySQL:
ERROR 1045 (28000) Access denied for user 'root'#'localhost' (using password: YES)
I have the user and password set in a my.ini file. It works when I turn WAMP on, but doesn't when I exit WAMP. Why is this, and how can I fix it?
I'm guessing that starting up WAMP somehow grants privelegs to 'root'#'localhost'?
Related
I have installed xampp in my ubunut 16.04 vps. It was running nicely with phpmyadmin. all of a sudden I can not login my phpmyadmin with root user. It just refused and give me the painful error which can not solve. the error is:
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: YES)
I can login with phpmyadmin supercontrol user... but the super user does not have any access to mysql.user table.
then I add "skip-grant-tables" to /opt/lampp/etc/my.cnf file and login with root user . Now I cant set the root user's password anyway.
Can anybody tell me what is the best way to get rid of this situation? thanks in advance
I have tried starting the mysql server but unanle to do so. I have changed the password which I am using while connecting to database, other things(hostname, port and username) remained same.
I have already checked mysql service in taskmanager, tried starting from command line and from mysql shell but still not able to succees.
C:\Program Files\MySQL\mysql-8.0.21-winx64\mysql-8.0.21-winx64\bin>mysql -u root -p
Enter password: **************
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
C:\Program Files\MySQL\mysql-8.0.21-winx64\mysql-8.0.21-winx64\bin>mysql start
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: NO)
Any help would be greatly appreciated.
Please find below the screenshots of the error.
cmd_error
taskmanager
workbench1
workbench2
I was facing the same error. I could connect using terminal but not using workbench.
I follow these steps and it worked for me: https://phoenixnap.com/kb/access-denied-for-user-root-localhost
I run this command:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'insert_password';
and then it was possible to access without admin privileges.
Everytime I open the mysql workbench, I see the access denied error 'root'#'localhost'. The below resolution works for me:
Open taskmanager
Go to service tab
Open services
For me, two services run MySQL and MySQL80.
I stop the MySQL service and start the MySQL80 service.
This resolves my issue.
After some google search, I found that there were two services MySQL and MySQL80 running in the services tab of task manager. I stopped the MySQL and started the MySQL80 service. This resolved my issue.
Go to C:/XAMPP/mysql/bin/
open my.ini (configuration setting type file)
under # The mysql server
[mysqld]
add a new line just after above heading and write skip-grant-tables enter image description here
ctrl+s (save)
open XAMPP control panel and click stop if your mysql server is already running and then click start again basically we are restarting the server and boom your problem is solved open workbench and try again to create a new connection.
I just set up mysql server 8.0 on my local machine. The first time login was fine and I created my database and everything, but since I wanted to load local files so I exited and did mysql -u root -p --local-infile databasename;. When I did that it gave me ERROR 1049 (42000): Unknown database 'databasename;'. Then I tried to login using mysql -u root -p to check the database but I got this error: ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I tried to restart mysqld but new error message pops up. And I tried to reset the root password it didn't work either.
So I tried to reinstall mysql. The exact same thing happened. The first time login was fine, but when I exit and did --local-infile databasename it said Unknown database 'databasename; again.
Could someone help me with this issue? Thank you! I'm using the widows system.
First I would recommend installing MySQL Workbench, which is the "official" MySQL GUI. It's not that great, but it makes troubleshooting these sort of problems much easier.
Next, If you can actually connect to your localhost instance with workbench, run this:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'yourPasswordHere'
If not, try reinstalling MySQL again and see if you can connect.
I am using Windows 8.1, installed the 64-bit Wamp server and unable to access phpmyadmin and mysql. The first error message I got when browsing to phpmyadmin was
#1045 - Access denied for user 'root'#'localhost' (using password: NO)
then I changed my password in config.inc.php and received the following
#1045 - Access denied for user 'root'#'localhost' (using password: YES)
then I changed $cfg['Servers'][$i]['auth_type'] to http and that did not work either. I tried to access the mysql console, was asked for a password again and nothing happened. So why do they make it so hard? I remember I had no such issue with xampp.
I must have tried every answer in stackoverflow for this problem, nothing works. Anyway:
I installed successfully mariadb 10 on centos 6.5, now I was trying to create database and all those things when I stumbled upon: Access denied for user ''#'localhost' to database 'mysql'. I seem to try logging in anonymously but I am really trying as root.
I logged in typing:
mysql -u root -p
Enter password: [none]
it entered and after I tried using mysql database:
MariaDB [(none)]> use mysql;
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'mysql'
I tried this locally by opening a tunnel in ssh as well
ssh -L 3306:localhost:3306 dev#machine.com
didn't work, also tried in bash...nothing works. Any other advice?