mysql没有创建数据库的权限设置_mysql 创建数据库,用户并给用户设置权限
mysql創(chuàng)建數(shù)據(jù)
create database?dataBaseName default charset utf8 collate utf8_general_ci; --創(chuàng)建數(shù)據(jù)庫并設(shè)置字符集
創(chuàng)建用戶
create user '用戶名'@'%' identified by '密碼'; -- ‘%‘ 是該用戶可以在任何機(jī)器上登錄
查詢用戶
select user,host.password from mysql.user;
給用戶設(shè)置所有權(quán)限(注意要用root登錄數(shù)據(jù)庫名不要用‘ ’號(hào) *?代表庫里所有表可以指定表)by?后邊為口令;
grant all privileges on wfldb20190828.* to 'wfl'@'%' identified by 'wfl';
給用戶設(shè)定指定庫、表?指定權(quán)限
grant create,alter,drop,select,insert,update,delete on wfldb20190828.* to 'wfl'@'%' identified by 'wfl';
設(shè)置完了記得的刷新權(quán)限
flush privileges;
--查看用戶?show grants for? 用戶名?;
show grants for test;
總結(jié)
以上是生活随笔為你收集整理的mysql没有创建数据库的权限设置_mysql 创建数据库,用户并给用户设置权限的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux修改端口cost值,Linux
- 下一篇: mysql存储过程捕获错误处理_mysq