1. View user-related information through the MySQL Database users table
Mysql>Use mysqlreading table information forCompletion of table and column namesyou can turn off Thisfeature to get a quicker startup with-adatabase Changedmysql>select Host,user,password from user;+-----------+------+-------------------------------------------+| Host | user | Password |+-----------+------+-------------------------------------------+| localhost | Root | *87f2746835a04895bb77e12aa5054a767******* | | Qxyw | Root | || 127.0.0.1 | Root | || localhost | | || Qxyw | | |+-----------+------+-------------------------------------------+5 rowsinchSet (0.00 sec)
2. Create a database
Default1 Row Affected (0.00 sec)
3. Create a user
mysql> create user ' dba ' @ '% ' identified by ' ******* '0 rows Affected (0.00 sec)
Meaning of the value of the host column in the user table% match all hosts localhost localhost will not be resolved to an IP address, directly via Unixsocket connection 127.0.0.1 will be connected via TCP/IP protocol and can only be accessed natively;:: 1 :: 1 is compatible with support IPv6, indicating the same as IPv4 127.0.0.1
4. Access to the DBA user for additional pruning and checking of the specified database
Mysql> Grant Select,insert,update,delete, create on [databasename].*0 rows Affected (0.00 sec)
Note: Be sure to refresh the service after modifying the permissions, or restart the service, refresh the service by: Flush privileges
MySQL CREATE database and create user and authorize