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 -pxxxxxxdatabasename换成数据库名称。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.