Reputation: 8903
I am trying to run a .sql in MySQL workbench. For this, I choose: File -> Run SQL script
option and finally provided the sql file name, in my case it is: sql_script.sql
However, when I run this, I got below message:
Preparing...
Importing sql_script.sql...
Finished executing script
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
As per this error message, it seems that it is expects to pass the credentials. I am not sure how to do this if my interpretation of this error message is correct.
Any information how to past this issue?
Upvotes: 2
Views: 2608
Reputation: 21
Try leaving the password blank. I had the same issue where I already connected to the database, entered my password, and saved it in the vault, but when running an SQL script it prompted me to enter the password, to which it would always give an access denied error. Leaving it blank worked.
Upvotes: 1
Reputation: 1080
On the top menu, you can connect to your database using Database > Connect to database then you can enter your credentials.
Upvotes: 2