Joshua Minchew
Joshua Minchew

Reputation: 45

'mysql' is not recognized as an internal or external command

When I try logging into MySQL through command line to create a new user its "not recognized". It might have something to do with my "socket"? On MySQL workbench my socket just says "mysql" i dont know if i should change that? I have no clue about mysql. PLease help.

Upvotes: 1

Views: 14354

Answers (3)

With "environment variables", search and click on "Edit the system environment variables":

enter image description here

Then, click on "Environment Variables...":

enter image description here

Then, set "C:\Program Files\MySQL\MySQL Server 8.0\bin" (in my case) to "Path" of either or both "User variables" or "System variables":

enter image description here

Then, with the command below, open MySQL Command-Line Client:

mysql -u root -p

Don't open MySQL Command-Line Client with the command below:

mysql

Because you will get this error below:

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

Upvotes: 2

MiltoxBeyond
MiltoxBeyond

Reputation: 2731

You have to either run mysql from the add installation path or add the path of MySQL to your system path variable.

The simplest solution is to execute from the installation path, which is most likely c:\program files\mysql\bin out something similar

Upvotes: 0

Alexander Bird
Alexander Bird

Reputation: 40688

If the error you are getting is 'mysql' is not recognized as an internal or external command, operable program or batch file. then you probably don't have mysql on the PATH. First, try closing your cmd window and open another one. After installing software, the PATH variable will be updated, but cmd windows don't update after they're opened.

Upvotes: 0

Related Questions