I've looked everywhere an cannot seem to find a fix for this issue, despite tons of articles on it. Anyway, I'm attempting the following command
mysqldump -hlocalhost -uroot -p mydb mytable > myexportedtable.sql
This will occasionally result in the following error
mysqldump: Got error: 1045: Access denied for user 'ODBC'#'localhost' <using password:NO> when trying to connect
This is baffling for two reasons. One - I am specifying a root user in my command however it assumes I'm ODBC. Two - I only get this error occasionally. (more often than not). I am able to authenticate to the mysql interactive shell when specifying root but keep getting this error with mySQL dump. Any insight is greatly appreciated as I've been trouble shooting this for days now.
Type in the command manually. Sometimes copying and pasting the command changes the hyphen character (-). It is ignoring the username because it literally doesn't recognize a -u.
This seems to happen when you connect with the wrong user to the database, wrong password usage or when you connect from the wrong host or over the socket/port when you are not allowed to.
I suggest checking the access privileges of the user like:
mysql> SELECT user, host FROM mysql.user WHERE user = 'jake';
mysql> SHOW GRANTS FOR 'jake'#'localhost';
Perhaps also take a look at mysqlimport: Error: 1045, Access denied , which helped me a lot.
Related
I have created a database using MySQL version 8.0.22 (I realize it's not the newest version but the newer version didn't work on my laptop). I need to have somebody (for who I made the database for) have full access to the database from their own laptop. I created their user with a password, granted full access, and flushed privileges.
CREATE USER 'user'#'localhost' IDENTIFIED BY 'password1234!';
GRANT ALL PRIVILEGES ON fsk TO 'user'#'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
However, I still got the error:
"Access denied for user 'user#'localhost' (using password: YES)"
I have been googling this error for the past two days and have everything from making sure there aren't any duplicates that contain "%" instead of "localhost" to reinstalling the program. For even more clarification, when trying to connect on MySQL Workbench, I entered 'localhost' for the "Hostname" field (didn't use quotes around localhost), the correct username, and finally, the correct password (made sure after attempting plenty of times very slowly).
Am I missing something with trying to get this working? I really just need one user to have full access to the database from another laptop and I keep getting "Access Denied" when trying to log in as that user I have created.
Any help would be GREATLY appreciated.
After successfully initializing mysql, it denies access to begin the mysql command.
mysql -u newkelsie
I never recalled setting a password, but I did hit blank enter once when it asked for a password so I am not sure if that might be the problem or if I could go back and set a password. I'm using the Administrator: Command Prompt so I believe I should have all access, but instead I'm getting a common error.
Error 1045 <28000>: Access denied for user 'newkelsie'#'localhost' <using password: NO>
I've also been getting the error when I put a password in.
One of the other suggestions to answer this problem I tried was creating a document in bin called "mysql-init.txt" It's contents include:
ALTER USER 'newkelsie'#'localhost' IDENTIFIED BY 'kelsie';
Which is supposed to set my password upon initialization. However, this is not the case. Is there a way I can get mysql running on my computer without the password?
For the last few years I logged in to my local mysql database by simply typing mysql on Terminal. But now, for some reasons I found that this doesn't work right now, with the access denied error:
ERROR 1045 (28000): Access denied for user 'me'#'localhost' (using password: NO)
Now I must log in to type the following:
mysql -uroot -proot
This is quite painstaking, so I rather want to swich back to when I just type in mysql to log in to the database.
I don't set it as an alias in my zsh shell, but I cannot remember how I set it way before, such that I don't need to type in my user and password.
So how can I set it such that I log in with mysql command only? I use Mojave beta.
I think your current connection has set up with a password try to create new connection with null or leave it blank when asking a password :)
I'm battling with a strange issue here.
I am setting up an Amazon EC2 server, installed with Ubuntu Server 12 LTS, to serve our web app.
I installed mysql, and then had some issues with being unable to access with the root password I had set.
Suspecting a conflict with a possible default install (I thought I had checked), I completely removed mysql including the user.
Starting fresh, I set a root password which then worked. I set up phpMyAdmin, got that working, but then when trying to set a password for a user following an import,
I got "could not find row" error.
Upon some searching I found that 'FLUSH PRIVILEGES;' could help remedy the problem. So I went back into the server, logged into mysql as root, and performed the flush command.
I was then logged out of phpMyAdmin with an access denied error, and since then have been unable to log back into mysql on the server.
The full error is:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I am quite confused, already spent a lot of time trying to find out what the problem could be. Any help would be much appreciated. Thanks in advance.
Ha! Use --databases and include only your DB:
http://dev.mysql.com/doc/refman/5.5/en/mysqldump-copying-to-other-server.html
This was caused by my data import being from a full mysqldump, which I did now know would contain all user tables including root, which therefore overwrote my root user.
I guess there is a way to prevent either the export or import of the mysql table somewhere.
Learn something new everyday, as they say..
I'm trying to use mysqldump in my server, from the command line.
root#xxxxx:/xx/xx/xx/backups/09-03-13# mysqldump db_name_xxxx --tab=. --user=xxxx
--password=xxxxx
mysqldump: Got error: 1045: Access denied for user 'xxxxx'#'localhost' (using
password: YES) when executing 'SELECT INTO OUTFILE'
So I assume it's a problem with username/password.
However, I can get into the MySQL command line fine using mysql, with exactly the same logon details.
What could be causing mysqldump to fail, but not mysql?
Your problem is not with the login details but with the user you are logging in as.
In order to carry out a mysqldump you need at least SHOW DATABASES, SELECT, LOCK privileges on every table in the database. Things get more complicated if you use more exotic options such as locking etc.
This is a faily good reference for what permissions you need for what options in mysqldump.