Install MySQL
This page serves as an example only, and describes a typical setup of MySQL Server on a Linux distribution like Ubuntu or Debian.
To work with sapio365, the version of MySQL must be at least version 10.11.
1 - Install MySQL
The MySQL server is not usually directly available as an installation package.
You’ll need to first download it from a repository. Here’s a link to the MySQL Community Downloads page.
Then install MySQL using the following command on Debian/Ubuntu-based systems:
sudo apt install mysql-server
2 - Secure instance
Once installed, we suggest to secure the MySQL instance right away.
Run the following script as an admin.
sudo mysql_secure_installation
This script lets you set a root password, remove anonymous users, disallow root remote login, remove the test database, and reload privileges.
By default, the installation usually only allows connections to the server from the machine where MySQL has been installed (basic security).
3 - Enable outside access
To use sapio365 with MySQL, you must enable access to it from the outside, according to your security policies.
Open the MySQL server configuration file (path may vary by distribution, common examples):
/etc/mysql/mysql.conf.d/mysqld.cnf(Ubuntu/Debian)/etc/my.cnfor/etc/mysql/my.cnf(other distributions)
In the
[mysqld]section, locate thebind-addresssetting.Change the line from:
bind-address = 127.0.0.1
to:bind-address = 0.0.0.0
Save the file and restart the MySQL service:
sudo systemctl restart mysql
Make sure that your firewall and network security groups only allow trusted clients to connect to the MySQL port (default 3306).
4 - Initialize the database
Security: Keep shared cache and collaboration SQL databases separate
We strongly suggest to create one database for your shared cache, and another for your collaboration data.
Suggested names | Database | User |
|---|---|---|
Shared cache (used in the example script below) | sapio365-cache | sapio365-cache-sql |
Collaboration | sapio365-collab | sapio365-collab-sql |
First, open a session in MySQL by running:
sudo mysql -u root -p
This will prompt you for the password to open the SQL console (use the root credentials you configured during mysql_secure_installation).
Second, run the following SQL commands to:
Create a new database.
Create a user who can connect from the outside, and give this user the proper privileges to this new database.
Example for the shared cache database:
CREATE DATABASE sapio365-cache;
CREATE USER 'sapio365-cache-sql'@'%' IDENTIFIED BY '-Your Password Here-';
GRANT ALL PRIVILEGES ON sapio365-cache.* TO 'sapio365-cache-sql'@'%';
FLUSH PRIVILEGES;
Repeat these steps to create the collaboration database and user, adjusting the names accordingly:
Example for the collaboration database:
CREATE DATABASE `sapio365-collab` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'sapio365-collab-sql'@'%' IDENTIFIED BY '-Your Password Here-';
GRANT ALL PRIVILEGES ON `sapio365-collab`.* TO 'sapio365-collab-sql'@'%';
FLUSH PRIVILEGES;
You are now ready to connect sapio365 to your MySQL server, using the host name or IP, port (default 3306), and the database/users you created above.