Reputation: 4158
I'm trying to import a database in Workbench, in localhost. I select the file (it's actyally a csv file) and when I click on "start import" I get this error:
Operation failed with exitcode 1
09:51:12 Restoring /home/carlo/Downloads/db_export.csv
Running: mysql --defaults-extra-file="/tmp/tmpt_73Sg/extraparams.cnf" --host=127.0.0.1 --user=carlo --port=3306 --default-character-set=utf8 --comments < "/home/carlo/Downloads/db_export.csv"
ERROR 1045 (28000): Access denied for user 'carlo'@'localhost' (using password: YES)
The problem seems to be the password, but I'm sure I'm inserting it correctly. Also, before clicking on "start import" I'm asked for the password to connect and it works. What could be wrong?
I created my user from the mysql shell client, following the instructions on the mysql website, like this:
CREATE USER 'carlo'@'localhost' IDENTIFIED BY 'carlo';
GRANT ALL PRIVILEGES ON *.* TO 'carlo'@'localhost' WITH GRANT OPTION;
CREATE USER 'carlo'@'%' IDENTIFIED BY 'carlo';
GRANT ALL PRIVILEGES ON *.* TO 'carlo'@'%' WITH GRANT OPTION;
Upvotes: 2
Views: 7523
Reputation: 386
I had a similar issue in MySQL Workbench 8. The error I got was:
ERROR 1045 (28000): Access denied for user 'user'@'ip' (using password: NO) Operation failed with exitcode 1
But this error was misleading, because it wasn't an error related to password, just that my user didn't have permission to LOCK TABLES. So the solution for me was to dump the table I wanted to import again, and add --skip-add-locks
flag after mysqldump (in my case I couldn't modify the DB user's permissions).
So if you run into this issue, also check your DB user's privileges.
Upvotes: 3
Reputation: 79
Have you done FLUSH PRIVILEGES after Grant?
Even if it doesn't work, can you give us out
SELECT USER, HOST FROM MYSQL.USER;
SELECT USER(), CURRENT_USER();
Upvotes: 0
Reputation: 53502
Since you are logged in already the import should work as expected. Just make sure you are importing an SQL file. The dump/restore feature in MySQL Workbench uses a private config file to avoid passing the password on the command line (which would be a security problem). However, it can only pass on what it was given. So, if your user name/PW combination doesn't work then you made a mistake there.
Grants are likely not the problem as the error is about a user not allowed to connect. So check especially this part. Also make sure you have the right host used (also for the user).
Upvotes: 0