I have connected to my Amazon bastion and am now trying to connect to my database. However, when I try to run mysql I get an error:
PS C:\Users\antoi> mysql --u admin -p password -h127.0.0.1 -P4000
mysql : The term 'mysql' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ mysql --u admin -pfswR6c9Vbq5AvBNd4jntUCzYJaeTP_7F -h127.0.0.1 -P4306
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (mysql:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
So I have MySQL here:
PS C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MySQL> dir
Directory: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MySQL
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 27/04/2021 08:20 MySQL Installer - Community
d----- 25/06/2021 11:33 MySQL Server 5.7
-a---- 14/06/2021 10:15 2238 MySQL Workbench 8.0 CE.lnk
Unfortunately there is not bin/
in my directory:
If you want to execute the command
mysql
from any directory you have to add to the "Environment Variables" of Window the path to theexe
Steps:
exe
PS: Excuse me, but my Windows is in English xD
Option 2:
From the console run the command:
Note: The "downside" is that it is temporary and only applies to the console session.