2.mysql
Service MySQL Status
MySQL--version
Mysql-h Server host address-u user name-P user Password
Exit exits
MYSQL-H host name-u user name-P connection remote MySQL
1, database Backup command
Mysqldump-h localhost-u root-p--default-character-set=utf8 dbname >backup.sql
2, Import the database:
Mysql-h localhost-u root-p--default-character-set=utf8 dbname < Backup.sql
3. Delete
Yum remove MySQL mysql-server mysql-libs compat-mysql51
Rm-rf/var/lib/mysql
Rm/etc/my.cnf
See if you have MySQL software:
Rpm-qa|grep MySQL
Some words continue to delete
4. Authorization one, MySQL authorization
The syntax for the GRANT statement is as follows:
GRANT Privileges (columns)
On what
To user Identifiedby "password"
With GRANT OPTION
1.grant Select,insert On * * to [e-mail protected] "local" identified by "123";
This command means that the authorized user "test" (whose password is "123") can only be logged on locally localhost and can be
Database
Any table ("*. *" Before "*" represents any database, and the latter "*" represents any table under the constraints of the previous "*") for select,insert operations.
2.grant Update,delete on Scut.student to [e-mail protected] "%" identified by "123";
This command means that the authorized user "test" (its password is "123") can be any host login, the database "Scut" under the table "Student" for update,delete operation.
3. Grant all on len.* to [e-mail protected] "%" identified by "123456";
This command means that the authorized user "Ca" (whose password is "123456") can log on to any host and perform all operations on all tables under the database "Len".
Second, MySQL licensing view
Select User from mysql.db where db= "Youdb"
Example: Viewing a user who has been authorized by the Len database
Select User from mysql.db where db= "Len"
"MySQL" common operations