1.0 Introduction
MySQL is a relational database. Around 2009, it was purchased by Oracle Corporation, which made it a licensing nightmare of a relational database, because Oracle Corporation is not a nice Corporation: you don't get to buy too many luxury yachts with niceness, I'm afraid. So, the code for MySQL was forked (i.e., copied) and thus was created MariaDB. MariaDB is practically identical to MySQL in functionality terms, though in the intervening 15+ years the two products have diverged in significant ways, too. Nevertheless, they are sufficiently identical that many database nerds use the name 'MySQL' when they, technically, ought to use 'MariaDB', and vice versa. This site and its Giocoso documentation is no exception: it will talk about 'MySQL' and expect you to mentally add the extra words 'or MariaDB'!
Giocoso Pro was, technically, written to work with MariaDB: running it using the 'proper' MySQL Oracle software was something of an afterthought ...and I'd accordingly recommend that you stick to using MariaDB for both the Pro database server and the Giocoso client end of things. The main reason for that is: testing. I use MariaDB on real, varied hardware and therefore the Giocoso Pro code gets tested extensively in that environment. I have some virtual machines which run 'proper' Oracle MySQL: I test in those too, but nowhere near as frequently as I do for MariaDB installations, and on nowhere near as diverse a range of hardware.
So, my recommendation is: use MariaDB, client and server.
However, if you insist on using proper Oracle MySQL, you can definitely do so -though you need to use it on both Giocoso clients and the Pro server. You cannot use a MariaDB client with a MySQL server, nor a MariaDB server with a MySQL client. One family or the other is fine, but don't mix them!
The trouble these days with trying to use proper Oracle MySQL is that most distros will automatically install MariaDB software components if you mention MySQL: they alias the two product names and proceed to install the free, open source, license-complications-free MariaDB despite you explicitly asking to install the Oracle-laden one 🙂 Worse, if you run the usual Giocoso installation or upgrade scripts after you've installed the proper MySQL software, you'll usually find that the MySQL stuff is auto-deleted and replaced by MariaDB equivalents, because that's what most distro's package managers are programmed to do. If you insist on using proper MySQL, therefore, you'll need to do things manually -which is what the following steps achieve.
I've written the following steps using Ubuntu and Debian-based distros, but they should be generally applicable to all other distros, provided only that you replace the 'sudo apt' commands with the equivalent package manager command for your distro (e.g., sudo dnf for Fedora, sudo zypper for OpenSuse and so on). Refer to your distro's specific documentation for variations in package names, too.
2.0 MySQL Server
The Giocoso Pro server is built on MariaDB by running a script downloadable from this site, and everything gets automated for you. Doing it with proper MySQL, however, is an entirely manual affair. To start with, you bring your distro up-to-date and then install the MySQL Server package, like so:
sudo apt update
sudo apt install mysql-server
Once that has been installed, you need to perform some configuration steps to make the database server accessible across the network, like so:
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
In the nano text editor, scroll around until you find the entry for bind-address and set it to the IP address of the server itself (which can be determined with the command ip addr). Here's me doing it for an Ubuntu box:
The right-hand terminal shows you the IP address of this server is 192.168.137.147. You then see me editing the mysqld.cnf file in the left-hand window, setting the bind-address to that IP address. Save the file: to have the changes picked up, you then need to restart the MySQL server daemon:
sudo systemctl daemon-reload
sudo systemctl restart mysql.service
Next, we make the installation a little more secure than it is by default by issuing the command:
sudo mysql_secure_installation
You are prompted with various questions, to which you should supply the following answers:
- n (implement password validation)
- y (remove anonymous users)
- y (disallow remote root logins)
- y (remove test database)
- y (reload privileges)
Next, we need a firewall that allows MySQL database traffic but blocks everything else. Issue the commands:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 3306/tcp
sudo ufw enable
sudo systemctl enable mysql.service
And finally, you then need to create the tables and user that Giocoso clients will expect to exist before they can connect to the new server:
sudo /usr/bin/mysql -e "create database giocoso3 character set = 'utf8mb4' collate = 'utf8mb4_general_ci'"
sudo /usr/bin/mysql -e "create user 'giocoso3'@'localhost' identified by 'giocoso3'"
sudo /usr/bin/mysql -e "create user 'giocoso3'@'%' identified by 'giocoso3'"
sudo /usr/bin/mysql -e "grant all on *.* to 'giocoso3'@'localhost'"
sudo /usr/bin/mysql -e "grant all on *.* to 'giocoso3'@'%'"
sudo /usr/bin/mysql -e "flush privileges"
At this point, you've got a proper, Oracle MySQL database server ready to offer services to Giocoso clients.
3.0 MySQL on the Giocoso Client Device
The simplest way to get a Giocoso Pro client using MySQL is to install Giocoso as normal: that triggers the automatic installation of the MariaDB client, but removing that and replacing it with the Oracle MySQL software is relatively straightforward, as follows:
Install or upgrade to Giocoso 3.30 in the normal way. For installation, the commands would be:
wget doco.absolutelybaching.com/gioinst
bash gioinst
For an upgrade of an earlier Giocoso version, you must not take the built-in check for upgrades menu option (it will break Giocoso if you try). Instead:
wget doco.absolutelybaching.com/upgrade330
bash upgrade330
The upgrade process will NOT have installed any MariaDB components, so an uninstall of them would only be necessary if they happen to be included by your distro by default or if you've previously installed them. This situation would make the 'remove mariadb' commands I show below return a message along the lines of 'mariadb-client is not installed': you can ignore that if it happens to you.
Otherwise, removal of MariaDB and replacement with Oracle MySQL is done as follows:
sudo apt remove mariadb-client mariadb-client-core
wget https://dev.mysql.com/get/mysql-apt-config_0.8.30-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.30-1_all.deb
That last command triggers this sort of response:
Arrow up and down each item in the main list, pressing Enter to select it and change it. You want to end up with the selections: mysql-8.0, MySQL Tools enabled and MySQL Preview enabled (though the last one can be disabled without consequence).
Once those three values are visible in the main list, arrow down to the 'OK' item in the main list and press [Enter] to confirm. This will take you back to the command prompt, where you then type:
sudo apt update
sudo apt install mysql-client
At this point, your distro is running 'proper' MySQL and you can proceed to enable Pro functionality within Giocoso itself as normal (i.e., take the Administration menu, Option 2 and set the 'MySQL IP address' to the IP address of the MySQL Server you prepared in Section 2 above). Use of Giocoso Pro functionality is standard fare from that point on.
[ User Manual Home ] | [ Build a Giocoso Pro Server ] | [ Giocoso Pro on MySQL ] | [ Giocoso Pro Menu ]