Featured image of post MySQL Common Commands

MySQL Common Commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
-- Switch to the MySQL database
MySQL [(none)]> use mysql;

-- View users
MySQL [mysql]> SELECT user FROM user;

-- View user permissions
MySQL [mysql]> show grants for user;

-- Create a user
mysql> CREATE USER 'xxx'@'%' IDENTIFIED BY 'xxxx';

-- Grant permissions
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON 数据库.数据表 TO user@'%';

-- Delete a user

mysql> DROP USER XXX
Built with Hugo
Theme Stack designed by Jimmy 🚀
Published: 58 Posts  |  Total Views: ... views
Uptime: ...  |  Site Visits: ... views