systemctl status mysqld.service
systemctl start mysqld.service
systemctl stop mysqld.service
create user 'sgf'@'%' identified by 'SGF_lll315';
select user,host from mysql.user;
drop user sgf@'%';
grant create,alter,drop,select,insert,update,delete on testdb.* to sgf@'%';
這裏受權只是給sgf這個用戶只授予數據庫「testdb」中表的建立,修改,刪除權限,以及表數據的增刪改查權限,可改爲全部數據庫 *.* 。
mysql
flush privileges;
show grants for sgf;