How to build a #MySQL server on #DigitalOcean

2016/12/07

DigitalOcean is awesome.

Untitled

Here is how to build a MySQL server on DigitalOcean, using Ubuntu 16.04. It’s pretty easy, right?

Installl

$ sudo apt-get install mysql-server
$ sudo mysql_secure_installation

Mysql Configuration

To allow network access, edit mysqld.cnf file.

$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf 

Change this line

bind-address           = 127.0.0.1

into

#bind-address           = 127.0.0.1

Firewall setting

https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

$ sudo ufw allow from xxx.xxx.xxx.xxx to any port 3306

Check the setting.

$ sudo ufw status

Restart mysql

$ sudo service mysql restart
<< 古い記事