How to connect from windows command prompt to mysql command line

后端 未结 16 1829
南旧
南旧 2020-12-12 23:30

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\\
         


        
16条回答
  •  囚心锁ツ
    2020-12-13 00:17

    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>
    

提交回复
热议问题