首先按照
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
安装MySQL
学到了如何添加用户和赋给sudo权限
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
adduser sammy
usermod -aG sudo sammy
不过还有两件事要做
第一件事是创建一个能够接受任何IP地址请求的Mysql用户:
切换到root用户
mysql -u root -p
https://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
WITH GRANT OPTION;
第二件事是开放阿里云端口
http://blog.csdn.net/wangjiawei0227/article/details/73430980
讲到阿里云端口需要编写安全组规则
有用的命令
netstat -ntpl
之后就是用sqlDeveloper连接MySQL
https://stackoverflow.com/questions/89696/how-do-you-connect-to-a-mysql-database-using-oracle-sql-developer
先去下载connector
https://www.mysql.com/products/connector/
然后
http://www.oracle.com/technetwork/developer-tools/sql-developer/mysql-connection-viewlet-swf-085075.html
配置用户名密码
都是MySQL用户名密码