I am trying to set up mysql on my Mac, but every time I type mysql on the command line I get:
ERROR 1045 (28000): Access denied for user 'arlet'#'localhost' (using
password: NO)
I type mysql -u root -p, and I get the same error.
I do not know if the server was set up correctly, because in the tutorial I am watching they activated it from preferences but in the installation package I got I did not have that option.
When I installed it I got a password and did not write it down, so I tried to reset it using the instructions in the manual Resetting the Root Password: Unix and Unix-Like Systems and no results. Please help.
Edit: Alright, I think it's best to delete mysql from my computer and reinstall it. I have tried sudo rm /usr/local/mysql and it does not work. How can I remove it?
Related
Please help me on this problem.
I installed mysql and workbench, but when i run mysql -u root -p and gives password, it gives error : ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES) but when i using workbench log into the database, it works fine.
There is several things you want to know first
-I had installed xampp before, (i already uninstalled xampp,but doesn't help)
-root is running on port 3307 as 3306 was already occupied.
-I have tried : set password for root="password"; but it gives ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'mysql'
-I am using windows 10 and using another user account not administator
-I am running the mysql version 8.0
I am new to these stuff. I searched for days and coudn't find any solution. help me. thanks
I have different ubuntu servers running mysql 8.
After installing the server I use to secure the installation with the same settings for all the servers.
First of all I disable the possibility for root to login remotely. After this change the command:
sudo mysql
will make me login with root user from the server shell while running
mysql -uroot -p
will keep me out and this is the expected behaviour.
On one server I run mysql_secure_installation with the usual procedure and everything worked as expected but:
sudo mysql
will keep me out with the message:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
while
mysql -uroot -p
will log me in normally (exactly the opposite of what I expect to be)
Where should I look for to solve this? Did anyone face the same issue before?
I'm setting up a MySQL database following this tutorial. I installed it and successfully initialized an instance with a root password, but I am having trouble connecting to the instance via command line. When I click on the 'mysql' executable under bin, I get this message
ERROR 1045 (28000): Access denied for user 'hunter'#'localhost' (using password: NO)
and if I try to enter
> mysql -u root -p
in the terminal I get this message
-bash: mysql: Permission denied
It says in the instructions that I should be getting prompted to enter the password for the database, but for some reason it won't let me.
I would suggest first off to try a mysql workbench. You can download it at https://dev.mysql.com/downloads/workbench/ .
It seems that calling mysql from bash is causing issues for you. If you are using a *Nix environment, it could be a permissions issue and you need to set the correct permissions on the mysql binary. However, usually a correct installation should have already done that. See: https://askubuntu.com/questions/229589/how-to-make-a-file-e-g-a-sh-script-executable-so-it-can-be-run-from-a-termi
Secondly, you should use the username root . hunter is not default username.
From the mysql documentation:
How to Reset the Root Password
If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root. However, this is insecure. For instructions on assigning a password, see Section 2.10.4, “Securing the Initial MySQL Account”.
Reference:
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
I'm a beginner with linux (linux mint distro) and I have been trying to install mysql server and workbench. I couldn't connect to mysql server without sudo command. I tried to connect to the server on workbench, and Access denied for user 'root'#'localhost'. So I try to run workbench with sudo from terminal. Nothing. So I followed what somebody posted here on stackoverflow about changing my password auth mode to mysql_native_password, and was able to access SQL Server from workbench (only using sudo command).
So I try to import a dump which I made on windows mysql-workbench, and it gives me two errors:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
and
ERROR 1115 (42000) at line 24: Unknown character set: 'utf8_general_ci'
Nevertheless, the database seems to have been correctly imported (I can see values and columns and tables and they look alright).
What's happening and how to stop getting these access denied errors? I tried to search the web and there are different answers, but none of them seem to address first install. I don't see why wouldn't it work if I have made a pretty default install :(
Thanks a lot!
ps: I don't know if more specific info is needed. anonymous user was dropped after installation
Try resetting root password.
Step 1. Access to mysql using mysql -uroot
Step 2. Check the root user
select Host, User, authentication_string from mysql.user;
Step 3. Change password for root user
use mysql;
update user set authentication_string=password('NEWPASSWORD') where user='root';
flush privileges;
quit;
Now try accessing to mysql using mysql -uroot -p using new password. If it works, use the credentials in workbench.
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.