The 1.user table has a% meaning for host:
The Host column specifies the IP that is used to allow the user to log on, such as User=root host=192.168.1.1. This means that the root user can only access it through the 192.168.1.1 client.
and% is a wildcard, if host=192.168.1.%, then it means that the IP address prefix is "192.168.1." Clients can connect. If host=%, indicates that all IPs have connection permissions. 、
This is why when the remote connection is turned on, most people directly change the host to%, for the sake of convenience.
The primary key in the 2.user table is the host and user federated primary key;
3. restrict Kaka user's login IP to 10.155.123.55,ip for handy write, if properly configured for you to effectively login IP, all IP login, then set host to '% '
Mysql> INSERT into Mysql.user (Host,user,password) VALUES ("10.155.123.55", "Kaka", Password ("kaka123"));
4. New user completed, refresh mysql system permissions related table
mysql> flush Privileges;
Note: MySQL new setup user or change password after use flush privileges refresh the MySQL system permission related table, otherwise there will be denied access, there is another way, is to restart the MySQL server for the new settings to take effect. -
5. New users:
Create user xh identified by ' XH '; Create a user xh and add a password of xh-
6. Modify the user password:
Update user set Password=password (' Monkey ') where user= ' xh '; Change XH user password to monkey-
7.user Permission Parameters
Select_priv: The user can select the data by using the Select command. Insert_priv: User can insert data via insert command; Update_priv: The user can modify the existing data through the update command; Delete_priv: The user can delete the existing data through the Delete command; Create_priv: Users can create new databases and tables; Drop_priv: Users can delete existing databases and tables; Reload_priv: The user can perform a specific command to refresh and reload the various internal caches used by MySQL, including logs, permissions, hosts, queries, and tables, and reload the permissions table; Shutdown_priv: The user can shut down the MySQL server and should be very cautious when giving this permission to any user other than the root account; Process_priv: Users can view the process of other users through the show processlist command; server management; File_priv: The user can execute the SELECT INTO outfile and load DATA infile commands and load the files on the server; Grant_priv: The user can grant the user's own privileges granted to other users (any user gives full privileges); References_priv; currently only a placeholder for certain future functions; it has no effect; Index_priv: Users can create and delete table indexes, query tables by index; Alter_priv: User can rename and modify table structure; Show_db_priv: The user can view the names of all the databases on the server, including those with sufficient access to the user, and may consider disabling this permission for all users, except for particularly irresistible reasons; Super_priv: Users can perform some powerful administrative functions, such as removing user processes through the KILL command, modifying global MySQL variables using set global, and executing various commands on replication and logging; Super privilege; Create_tmp_table_priv: Users can create temporary tables; Lock_tables_priv: The user can use the Lock Tables command to block access/modification to the table; Execute_priv: User can execute stored procedure; This permission is only meaningful in MySQL 5.0 and later; Repl_slave_priv: Users canReads the binary log file used to maintain the replicated database environment, which is located in the main system, facilitates communication between host and client, and master server management; Repl_client_priv: The user can determine the location of replication from the server and the primary server, from the server management; Create_view_priv: Users can create views; This permission only makes sense in MySQL 5.0 and later; Show_view_priv: The user can view the view or understand how the view executes; This permission only makes sense in MySQL 5.0 and later; Create_routine_priv: The user can change or discard stored procedures and functions; This permission was introduced in MySQL 5.0; Alter_routine_priv: The user can modify or delete the stored functions and functions; This permission was introduced in MySQL 5.0; Create_user_priv: The user can execute the Create user command, which is used for creating a new MySQL account; Event_priv: User can create, modify, and delete events; This permission is new to MySQL 5.1.6; Trigger_priv: User can create and delete triggers, this permission is MySQL 5.1.6 new; Create_tablespace_priv: Create tablespace ssl_type: Support SSL standard encryption security field Ssl_cipher: Support SSL standard encryption security field X509_issuer: Support x509 standard field X5 09_subject: Supports x509 standard field max_questions:0 How many queries are allowed per hour max_updates:0 How many updates can be performed per hour: 0 means unlimited max_connections:0 per small How many connections can be made when: 0 means unlimited max_user_connections:0 the number of connections that a single user can have at the same time: 0 means unlimited plugin:5.5.7 start, MySQL introduces plugins for password authentication when user connects, plugin Create an external/proxy user authentication_string: by authentication_string You can control the mapping of the two, (Pam plugin, Pam can support multiple service names), especially when using a proxy user, and you must declare thisA little password_expired: password expires Y, indicating that the user password has expired n instead
MySQL Database new user