2

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?

2
  • Are you already connected? What is the output of select current_user(); Then give output of show grants for root@localhost; (don't show the password hash here). Also show the script you are running. Commented Mar 30, 2016 at 8:39
  • it seems you are sending password "(using password: YES)" are you sure it is correct one ? Commented Mar 30, 2016 at 8:48

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

I did it, however it is still give me the same error.
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.