MySQL

A, install,

(1) Download and install community version 5.5.62 from the official website

(2) Download and install the software of visual operation database: Navicat

MySQL > connect to mysql. MySQL > connect to mysql. MySQL > connect to mysql. MySQL > connect to mysql. MySQL > connect to mysql. MySQL > connect to mysql. root

Second, the use of

1. Start and stop the MySQL service

Control Panel –> Search services –> Local Services —-> Find MySQL

2. Log in to and out of the MySQL service

Windows + R –> CMD –> SQL -u root -p

Exit: CTRL + C/exit

3. Common MySQL commands

  • Look at all the libraries

show databases; (Be sure to add a semicolon.)

  • Opens the specified library

Use the library

  • View all tables in the current library

show tables;

  • View all tables in other libraries

Show tables from database name;

  • Displays which library is currently in

select database();

  • Create a table
Create table table name (column name column type, name varchar(20), column name column type...) ;Copy the code
  • View the internal structure of the table

Desc table name;

  • Check the version

select version(); 或者 mysql --version