mysql command-line commonly used commands

Starting and stopping mysql service

  • Enter cmd net start service name

  • net stop service name

  • Exit: exit

  • Login: mysql [-h hostname -p port number] -u root -p

mysql commonly used commands

  1. show databases; // display the database

  2. use database name; // switch databases

  3. show tables [from the database name] // display the database table

  4. desc table name; // view the structure of the table

mysql syntax specification

  1. not case sensitive

    Keyword suggestion capitalized, ranked table name in lowercase

  2. Command ";" at the end

  3. Note

    1. Single line: # comments
    2. Single line: - Space Comment
    3. Multi-line: / * comment * /

Guess you like

Origin www.cnblogs.com/l1057618497/p/12222907.html