Reputation: 45
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
Reputation: 1
With "environment variables", search and click on "Edit the system environment variables":
Then, click on "Environment Variables...":
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":
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
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
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