MySQL Add user settings
If you need to add a MySQL user, you only need to add new users to the user table in the MySQL database.
To add an instance of the user, the user name is guest, the password is guest123, and the user is authorized to perform Select,insert and update operation permissions
SHOW DATABASES;
Use MySQL;
SHOW TABLES;
SELECT * from USER;
INSERT into USER (host,user,password,select_priv,insert_priv,update_priv) VALUES (' localhost ', ' guest ', PASSWORD (' Guest123 '), ' y ', ' y ', ' y ');
SELECT * from USER;
FLUSH privileges;
When adding a user, be aware that the password is encrypted using the password () function provided by MySQL.
Note the flush privileges statement needs to be executed. This command will reload the authorization table when it is executed. If you do not use this command, you will not be able to use the newly created user to connect to the MySQL server unless you restart the MySQL server.
You can specify permissions for the user when you create the user, and in the corresponding permission column, set the ' '
Select_priv insert_priv update_priv delete_priv create_priv drop_priv reload_priv Shutdown_priv Process_priv File _priv grant_priv references_priv index_priv alter_priv show_db_priv super_priv create_tmp_table_priv Lock_tables_p Riv execute_priv repl_slave_priv repl_client_priv create_view_priv show_view_priv create_routine_priv Alter_routine _priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv
Another way to add users is through the SQL Grant command, the following command given the database demo add user Zara, the password is zara123.
GRANT Select,insert,update,delete,create,drop on demo.* to ' Zara ' @ ' localhost ' identified by ' zara123 ';
MySQL Add user settings