CuriousMind
CuriousMind

Reputation: 8903

Running sql scripts in MySQL workbench

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

Answers (2)

Mikus Lorencs
Mikus Lorencs

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

Jérôme
Jérôme

Reputation: 1080

On the top menu, you can connect to your database using Database > Connect to database then you can enter your credentials.

enter image description here

Upvotes: 2

Related Questions