创建用户:
create user test identified by '123456';
授权:
grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option;
修改mysql配置文件:
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf注释掉下面这一行:bind-address = 127.0.0.1
重启:
sudo service mysql restart
参考文档: