先使用root用户进入mysql
mysql -uroot -p
创建新用户
create user 用户名 identified by '密码';
赋予所有权限
GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
刷新一下
FLUSH PRIVILEGES;
mysql -uroot -p
create user 用户名 identified by '密码';
GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;