Actions

Install/3-2/Database: Difference between revisions

From Convention Master Documentation

(Created page with "<div style="float:right;"> Next: 3.2 - Connect Convention Master to the Database >> </div> Install/3-1/License|<< Previously: 3.1 - Add Your License...")
 
(update to mysql 8 steps)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="float:right;">
<div style="float:right;">
[[Install/3-3/CMConfig|Next: 3.2 - Connect Convention Master to the Database >>]]
[[Install/3-3/CMConfig|Next: 3.3 - Connect Convention Master to the Database >>]]
</div>
</div>
[[Install/3-1/License|<< Previously: 3.1 - Add Your License]]
[[Install/3-1/License|<< Previously: 3.1 - Add Your License]]
Line 10: Line 10:
'''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 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.


    <code>sudo mysql_secure_installation</code>
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:


<syntaxhighlight lang="bash">
    sudo joe /etc/mysql/mysql.conf.d/convention_master.cnf
</syntaxhighlight>


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:


    <code>sudo joe /etc/mysql/mysql.conf.d/convention_master.cnf</code>
In this new file, place the following three lines:


 
<syntaxhighlight lang="bash">
In this file, place the following two lines:
[mysqld]
 
sql-mode="NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
    <code>[mysqld]</code>
log-bin-trust-function-creators=1
    <code>sql-mode="NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"</code>
</syntaxhighlight>




Save the new file and close. To activate it, let's restart the MySQL service:
Save the new file and close. To activate it, let's restart the MySQL service:
 
<syntaxhighlight lang="bash">
     <code>sudo systemctl restart mysql</code>
     sudo systemctl restart mysql
</syntaxhighlight>




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):
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):
 
<syntaxhighlight lang="bash">
     <code>sudo mysql</code>
     sudo mysql -u root -p
</syntaxhighlight>




You should see the MySQL monitor's interactive prompt. From here we can create a new database for Convention Master:
You should see the MySQL monitor's interactive prompt. From here we can create a new database for Convention Master:
 
<syntaxhighlight lang="MySQL">
     <code>CREATE DATABASE convention_master;</code>
     CREATE DATABASE convention_master;
</syntaxhighlight>




Finally, let's create a user that can access this database:
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.
<syntaxhighlight lang="MySQL">
    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;
</syntaxhighlight>


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


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 installing Convention Master.
All done! With the database and user created, we can proceed to with the installation of Convention Master.

Latest revision as of 18:03, 6 October 2023

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