Life is a sail trip full of chances and challenges.
Life is a sail trip full of chances and challenges.
linux上使用命令行操作。
root
用户进入mysql
数据库。mysql> mysql -uroot -pxxxxxx
databasename
换成数据库名称。mysql> CREATE DATABASE `databasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
username
为用户名,password
为密码。mysql> CREATE USER username IDENTIFIED BY 'password';
username
用户在databasename
上的权限,all
代表所有,可分为INSERT
,SELECT
,UPDATE
等权限,%
代表任何ip
都可访问该数据库。mysql> grant all privileges on databasename.* to 'username'@'%';
mysql
已分配角色权限)mysql> GRANT ops TO 'username'@'%';
ops
为一个已存在的角色,则用户username
就具备了ops
所有权限了。
mysql> FLUSH PRIVILEGES;
评论没有加载,检查你的局域网
Cannot load comments. Check you network.