Actions

Install/3-2/Database

From Convention Master Documentation

Revision as of 03:40, 30 September 2023 by Alofoxx (talk | contribs)

<< 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.

If you have not previously done so, run the MySQL installation security wizard. This will help you set password policies, a root password for the system, disable unneeded access methods, etc.

   sudo mysql_secure_installation


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

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


In this file, place the following two lines:

   [mysqld]
   sql-mode="NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"


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


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:

   GRANT ALL PRIVILEGES ON convention_master.* TO CMUser@localhost IDENTIFIED BY 'yourpasswordgoeshere';
   FLUSH PRIVILEGES;


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