Database terminology and client login of Mysql database
After installing the database, we need to understand some of its basic concepts, as mentioned earlier: the database is made up of multiple related tables. Then this table includes such as rows, columns, primary keys, foreign keys, indexes, and so on.
Database: a collection of associated tables.
Datasheet: a table is a matrix of data, and the table in the library can be regarded as a spreadsheet.
Column: a column contains data of the same nature, such as age and phone number.
Line: a set of related data, also known as a data record.
Primary key: the primary key is unique, and only one primary key can be contained in a data table. You can use the primary key to query the data.
Foreign key: mainly used to associate two tables.
Index: use the index to quickly query the records in the data table, similar to the catalog of books.
How to connect the Mysql database:
Windows:
1 go to the official website to download the Windows version of Mysql is usually an executable file that ends in .msi; (you can also install the Mysql client, according to your personal habits)
2 after the installation is completed, you need to modify the environment variables of the Windows system: see the following figure:
3 Open port 3306 on the Mysql server:
Iptables-I INPUT 1-d 192.168.159.137-p tcp-- dport 3306-j ACCEPT (IP is my virtual machine address)
4 Open the Windows system cmd command prompt: enter the following command:
Mysql-u user name-h 192.168.159.137-p
After you enter, you will be prompted to enter your password:
Linux:
Same as step 4 above; if you don't have a password, just type mysql.