Install/3-2/Database: Difference between revisions
From Convention Master Documentation
Silvershock (talk | contribs) No edit summary |
(update to mysql 8 steps) |
||
(One intermediate revision by the same user not shown) | |||
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.''' | ||
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> | |||
In this new file, place the following three lines: | |||
<syntaxhighlight lang="bash"> | |||
[mysqld] | |||
sql-mode="NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION" | |||
log-bin-trust-function-creators=1 | |||
</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"> | |||
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"> | |||
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"> | |||
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> | |||
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 | 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.