How to connect from windows command prompt to mysql command line

后端 未结 16 1928
南旧
南旧 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:07

    1. Start your MySQL server service from MySQL home directory. Your one is C:\MYSQL\bin\ so choose this directory in command line and type: NET START MySQL
      (After that you can open Windows Task Manager and verify in Processes tab is mysqld.exe process running. Maybe your problem is here.)
    2. Type: mysql -u user -p [pressEnter]
    3. Type your password [pressEnter]

    or make a start.bat file:

    1. add C:\MYSQL\bin\ to your PATH
    2. write a start.bat file
    3. My start.bat file has only two lines like below:
      net start MySQL
      mysql -u root -p

    Good luck!

提交回复
热议问题