<aside> ⚠️ Your MySQL version must be 5.7 or higher!

</aside>

Installing a database server

You can either install a MySQL server on each game node or have centralized MySQL servers for multiple game servers. In this example, we'll install a MySQL server on our game server.

First, start by installing a MySQL server. We will use MariaDB for this example.

apt install -y mariadb-server

Allowing external connections

<aside> 👨‍🚒 If you're using an OS with a firewall and/or a firewall appliance sitting in front of your servers, you may also need to allow TCP connections to the 3306 port on your server.

</aside>

By default, most MySQL servers are set up to block remote connections. However, you can change this by editing the configuration file my.cnf located by default at /etc/mysql/my.cnf. Type find /etc -iname my.cnf to find the file location on your system.

Add the following lines to the bottom of the file to allow all remote connections. You'd also want to increase the max connections because the default limit of 150 can quickly be reached when hosting many servers, plugins, and users connecting to their databases.

[mysqld]
bind-address=0.0.0.0
skip-name-resolve
max_connections=300

Once you've done that, make sure you restart the MySQL server. You can restart the service with the following command

service mysql restart

You can confirm that the above changes were applied by checking that the MySQL service is listening on 0.0.0.0 using the command ss -plnt | grep 3306 The output should look like this:

	LISTEN 0 80 127.0.0.1:3306     0.0.0.0:*

Creating a user for WISP

To create databases and users, we need to add a user for WISP to connect to the database. If you want a more secure setup, make sure you read all the way to the bottom of this page before adding the user.

To login to the MariaDB server by default, you need to type mysql -u root. Once you're logged in, you'll want to create a user for WISP & give it the correct permissions.