MySQL is the same under Windows and Linux commands, so the tutorial in Windows environment is as capable as running under Linux.
Enter the database
Mysql-u account name-p password
Exit database
Exit
Database server, database, table, record relationship
There are multiple databases in a MSYQL server
There are multiple tables in a database
There are multiple records in a table
Object vs. Relational mapping
Class-Table
Properties-Fields
Objects-Records
Show databases: Querying all databases in the MySQL server
Use database name: Select a database
Show tables: Querying all tables in the database
Create the database, if it is available directly, if not, create
Create DB if not EXISTS database name
Create a database that uses the UTF-8 character set
Create database if not exists DB name character Set UTF8
Note: Creating a database is by default using the UTF-8 character set.
The UTF8 character set in the database is the UTF-8 character set, which is different.
Modifying the character set of an existing database
Alter DATABAE database name character Set modified character set
NOTE: Alter is a variety of modifications to an existing database, followed by a certain statement.
Deletes an existing database and does not operate if it does not exist
Drop DB if exists database name
To view the definition information for a database that has been created
Show CREATE DATABASE name
Delete a database that already exists
Drop DB if exists database name
Backing Up the database
Mysqldump-u Account-P database name > path + file name
Recovering a Database
Source Path + file name (in MySQL environment)
Note: The backup referred to here refers to copying the contents of the database into the corresponding SQL file, restoring the contents of the SQL file to a table in the database. When recovering, the database is created and used, and then restored through Sorce because there is only table information in the SQL file and no database information.
Notes on MySQL-1