Actions

Install/3-2/Database

From Convention Master Documentation

Revision as of 19:03, 6 October 2023 by Alofoxx (talk | contribs) (update to mysql 8 steps)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<< Previously: 3.1 - Add Your License

Configuring the Database

In order to install Convention Master, it needs a MySQL database in which to store its data. We need to create a database on your system, and a MySQL user account to access it. This section of the guide will run you through that process.

If you already have a blank database provisioned on your host/by your hosting company, skip this step and proceed to the next page.


We need to disable some mode switches in MySQL in order for Convention Master to function. Let's go ahead and create a custom MySQL configuration file for Convention Master:

    sudo joe /etc/mysql/mysql.conf.d/convention_master.cnf


In this new file, place the following three lines:

[mysqld]
sql-mode="NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
log-bin-trust-function-creators=1


Save the new file and close. To activate it, let's restart the MySQL service:

    sudo systemctl restart mysql


Next, let's create the database and user account Convention Master needs to install itself. Execute the following command to log into MySQL as its super-user (root):

    sudo mysql -u root -p


You should see the MySQL monitor's interactive prompt. From here we can create a new database for Convention Master:

    CREATE DATABASE convention_master;


Finally, let's create a user that can access this database: Note: replace your_new_mysql_cm_password with your own unique password that you will need to enter during Convention Master installation.

    CREATE USER 'CMUser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_mysql_cm_password';
    GRANT ALL PRIVILEGES ON convention_master.* TO 'CMUser'@'localhost';
    FLUSH PRIVILEGES;
    exit;


Please make sure to note that your database name is 'convention_master', your database user is 'CMUser', and your database user password is what you replaced your_new_mysql_cm_password with. You will enter these during installation.

All done! With the database and user created, we can proceed to with the installation of Convention Master.