Install MySQL using the RPM package and set iptables for TCP port 3306.
Root Password Management sets the root user's password mysqladmin-uroot password 'Password '.
Modify the root user password mysqladmin-uroot-P password 'Password '.
Database and table management go to mysqlmysql-H hostname-uroot-P.
Create mysql> Create Database location.
Import the data structure mysql-uroot-P location <./location. SQL.
View the database mysql> show databases;
Enter a database mysql> use location;
View table information mysql> show tables;
View the table structure mysql> DESC contact;
Change the table name mysql> rename table contact to contact_new.
Delete database mysql> drop database location.
Delete A Table mysql> drop table contact.
In the authorization section, create a user and authorize mysql> grant all on location. * To gk1020 @ '10. 1.11.71 'identified by 'gk1020 '.
Unauthorize mysql> revoke all on location. * From gk1020 @ '10. 1.11.71 '.
Refresh the permission mysql> flush privileges.
The operation statement queries mysql> select * from contact.
Mysql> select count (*) from contact.
Modify mysql> Update contact set regtime = '2017-01-01 00:00:00 'Where id = 1.
Mysql> Update contact set regtime = '2017-01-01 00:00:00 ', cid = 1 where id = 1.
Insert mysql> insert into contact values ('',''...)
Mysql> insert into contact (ID, CID, contact) values ('',''...)
Delete mysql> Delete from contact where id = 1.
Export the exported database locationmysqldump-uroot-P location>./location. SQL.
Export a table mysqldump-uroot-p -- database location -- table contact>./contact. SQL.
Export the database location data structure mysqldump-D-uroot-P location>./location. SQL.
Copy table copy table contact is contact_bakmysql> Create Table contact_bak as select * from contact.
Copy the table contact structure mysql> Create Table contact_bak as select * From contact where 1 = 2.
View the running task mysql> show processlist.
Note:
Location is the database name, and contact is the table name.