1. Create a MySQL database 1. Create database syntax --Create a database named "testdb" and set the encoding set to utf8 CREATE DATABASE IF NOT EXISTS testdb DEFAULT CHARSET utf8 COLLATE utf8_general_ci; 2. Create a User 1. Create a new user --Created a user named: test with password: 1234 create user 'test'@'localhost' identified by '1234';
2. Query users --Query user select user,host from mysql.user; 3. Delete User --Delete user "test" drop user test@localhost ; --If the created user is allowed to log in from any computer, delete the user as follows drop user test@'%'; 4. Change your password --Method 1, real-time password update; change the password of user "test" to "1122" set password for test =password('1122'); --Method 2, requires refreshing; change the password of user "test" to "1234" update mysql.user set password=password('1234') where user='test' --refresh privileges; 5. User Assignment Permissions --Grant user test all privileges on the database "testdb" through the external network IP grant all privileges on 'testdb'.* to 'test'@'%' identified by '1234'; --Flush privileges; --Grant user "test" the permissions to create, modify, and delete tables in the database "testdb" through the external network IP, as well as the permissions to add, delete, query, and modify table data grant create,alter,drop,select,insert,update,delete on testdb.* to test@'%'; 6. Check user permissions --View user "test" show grants for test;
The above is all the relevant knowledge points introduced this time. Thank you for your learning and support for 123WORDPRESS.COM. You may also be interested in:
|
<<: jQuery implements all selection and reverse selection operation case
>>: VirtualBox installs CentOS7 virtual machine and enhancement tools (picture and text)
This article example shares the specific code of ...
Table of contents 1. Preprocessing 2. Pretreatmen...
This article shares the specific code of js to re...
1. Introduction to inode To understand inode, we ...
This article example shares the specific code of ...
Table of contents Event-driven and publish-subscr...
This article shares with you how to implement dra...
Linux has been loved by more and more users. Why ...
1. Stop the mysqld.exe process first 2. Open cmd ...
Use v-model to bind the paging information object...
Table of contents Overview Subqueries Subquery Cl...
Table of contents What is a trigger Create a trig...
What is the role of http in node The responsibili...
Table of contents Create a table View the databas...
Written in front Nginx is not just a reverse prox...