Skip to main content
Version: 2.1.8

MariaDB and MySQL

Every HiTechCloud Panel server runs MariaDB on port 3306. It is the database server the panel uses for its own tables, the one every hosting account gets by default, and the one this documentation means whenever it says "the database server".

A server can also run Oracle MySQL 8.4 LTS on port 3307, at the same time. Both servers are running, each with its own data, and an account uses one or the other. This is for accounts whose applications need Oracle MySQL specifically — a function MariaDB does not have, or a vendor who supports nothing else.

It is off by default. MariaDB is enough for almost everything, and a second database server is a second thing to keep running, backed up and patched.

Why it is not a package​

mysql-server and mariadb-server conflict in every repository on every distribution HiTechCloud Panel supports: both declare Provides: mysql-server, so installing one removes the other.

On a server that is hosting customers, apt install mysql-server does not add a second database server. It uninstalls MariaDB and takes every database on it. Nobody should be one command away from that, so HiTechCloud Panel does not install MySQL from a repository at all.

Instead it unpacks Oracle's own generic Linux tarball into a tree of its own:

MariaDBMySQL 8.4
Port33063307
Data/var/lib/mysql/var/lib/hitechcloud-mysql
Socketthe distribution's/run/hitechcloud-mysql/mysql.sock
Servicemariadbhitechcloud-mysql
Runs asmysqlhitechmysql
Installed bythe distributionHiTechCloud Panel

Nothing about MariaDB is touched: no package is removed, no unit is masked, no configuration file is rewritten, and mysql on the command line still opens MariaDB. Removing MySQL again leaves MariaDB exactly as it was.

Both servers listen on 127.0.0.1 only. Nothing reaches either from outside the machine.

Installing it​

On a new server:

bash INSTALL.sh --with-mysql

On a server that is already running:

hitechcloudcli native-mysql84 install

The download is 76 MB and comes from the HiTechCloud mirror. It takes about a minute on most connections.

MySQL 8.4 is built for x86_64 and aarch64. Only the x86_64 build is mirrored; an arm64 server downloads the full tarball from Oracle instead, which is considerably larger.

Moving an account onto MySQL​

An account's ~/my.cnf decides which server it uses. Moving an account creates its login on the other server — with the password it already has, so nothing the account or its applications hold has to change — and rewrites that one file.

hitechcloudcli native-mysql84 adopt alice # move alice onto MySQL
hitechcloudcli native-mysql84 release alice # move her back to MariaDB
hitechcloudcli native-mysql84 engine alice # which server is she on?
hitechcloudcli native-mysql84 accounts # who is on MySQL?

Databases do not move with the account. MariaDB and MySQL 8.4 differ in ways that make a silent copy dishonest, so both commands refuse while the account still has databases on the server it is leaving, and say so:

✖ alice has 3 database(s) on MariaDB. They do not move with the account
and would be unreachable.
✖ Export them first (Databases > Export in the panel, or mysqldump), then
run this again and import them into MySQL.

Export first, move the account, then import. The panel picks up the change on the account's next request; no restart is needed.

The account keeps its login on the server it left, so moving back is not a re-provisioning.

Checking on it​

hitechcloudcli native-mysql84 status
MySQL: 8.4.11 (running), port 3307, answering: yes
MariaDB: active, port 3306
Data: /var/lib/hitechcloud-mysql

A server that is running but not answering is reported as exactly that, with the last lines of its error log — that state means the unit is up and the credentials or the socket are wrong, which systemctl status will not tell you.

Both servers appear on the Services page as separate rows, named by port so they cannot be confused with each other.

The MySQL root password is generated during the install and stored in /etc/hitechcloud/mysql/root.cnf, mode 0600, readable by root alone. It is never printed. To open a root client against MySQL — never against MariaDB — use:

hitechcloudcli native-mysql84 cli

Removing it​

hitechcloudcli native-mysql84 remove # keeps the databases
hitechcloudcli native-mysql84 remove --delete-data # deletes them too

Move every account back to MariaDB first, or they will be pointed at a server that is no longer there.