How can I access the MySQL command line with XAMPP for Windows?

前端 未结 15 2284
甜味超标
甜味超标 2020-11-28 00:54

How can I access the MySQL command line with XAMPP for Windows?

15条回答
  •  借酒劲吻你
    2020-11-28 01:39

    In terminal:

    cd C:\xampp\mysql\bin
    
    mysql -h 127.0.0.1 --port=3306 -u root --password
    

    Hit ENTER if the password is an empty string. Now you are in. You can list all available databases, and select one using the fallowing:

    SHOW DATABASES;
    USE database_name_here;
    
    SHOW TABLES
    DESC table_name_here
    SELECT * FROM table_name_here
    

    Remember about the ";" at the end of each SQL statement.

    Windows cmd terminal is not very nice and does not support Ctrl + C, Ctrl + V (copy, paste) shortcuts. If you plan to work a lot in terminal, consider installing an alternative terminal cmd line, I use cmder terminal - Download Page

提交回复
热议问题