I\'m trying to connect to mysql server command line from my windows prompt
I write the next line in cmd but i get an error.
cd C:\\MYSQL\\bin\\
First jump to the mysql bin directory. You have two ways to connect
1) mysql -u root -p1234 (without space for password flag) 2) mysql -u root -p and enter the password when it is asking
Use this :
mysql -u user_name -p then press_enter_key
then type password
i.e.
line-1 : mysql -u root -p
line-2 : admin
Your have to go on mysql installed path is on drive C:, then your commands need to be:
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql.exe -u root -p
OR
C:\>cd \MYSQL\Bin
C:\MYSQL\Bin>mysql -u root -p
That will ask your MySql password over command prompt:
Enter password: ******
Put the password and you will get mysql dashboard.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4622
Server version: 5.7.14-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
first type cmd
then the windows command prompt will appear:
PATH C:\XAMPP\MYSQL\BIN;%PATH%;
mysql -u root -p
where:
If you don't want to go to bin
folder of MySQL then another option is to put a shortcut of mysql.exe
to your default path of command prompt (C:\Users\"your user name">
) with the contents of:
mysql -u(username) -p(password)
You are logging in incorrectly; you should not include = in your login. So to log in, type:
mysql.exe -uroot -padmin
If that doesn't work, then you may not have your system configured. If so, then here's a good tutorial on getting started with the MySQL prompt: http://breakdesign.blogspot.com/2007/11/getting-started-with-php-and-mysql-in_11.html