# 为用户授权 # root建库 create database blog; # root授权 grant create,select,update,insert on blog.* to php_wr@localhost IDENTIFIED BY '123456'; # 删除用户 delete from mysql . user where user = 'blog'; flush privileges;
一、grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。 grant select on testdb.* to common_user@'%' grant insert on testdb.* to common_user@'%' grant update on testdb.* to common_user@'%' grant delete on testdb.* to common_user@'%' 或者,用一条 MySQL 命令来替代: grant select, insert, update, delete on testdb.* to common_user@'%'