Oftentimes /opt is used for such a purpose.
The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary Interface [AT&T 1990], based on the System V Interface Definition (Third Edition), provides for an /opt structure very similar to the one defined here.
And games are additional (i.e. nonnecessary) software.
In the tutorial you should install mariadb-server in place of mysql-server.
I've got the same problem on DEBIAN 9 install and these command worked for me :
sudo apt purge mysql*
sudo apt purge mariadb*
sudo apt autoremove
sudo apt autoclean
Check if still something in the system :
dpkg -l | grep -e mysql -e mariadb
if the list is empty then install mariadb server :
sudo apt install mariadb-server
Now try to check status on stop and start the database :
Status after install :
sudo systemctl status mysql.service
● mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-03-21 16:08:49 CET; 2min 1s ago
Main PID: 15699 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
└─15699 /usr/sbin/mysqld
.../..
Check the PID :
sudo more /var/run/mysqld/mysqld.pid
15699
Stop the database :
sudo systemctl stop mysql.service
sudo systemctl status mysql.service
● mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2018-03-21 16:14:35 CET; 1s ago
Main PID: 15699 (code=exited, status=0/SUCCESS)
Status: "MariaDB server is down"
.../...
You could check the PID file is not present as well
sudo more /var/run/mysqld/mysqld.pid
more: stat on /var/run/mysqld/mysqld.pid: No file or folder
Start the database :
sudo systemctl start mysql.service
sudo systemctl status mysql.service
● mariadb.service - MariaDB database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-03-21 16:14:54 CET; 3s ago
Process: 15911 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 15908 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 15791 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_S
Process: 15787 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 15784 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Main PID: 15881 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 26 (limit: 4915)
CGroup: /system.slice/mariadb.service
└─15881 /usr/sbin/mysqld
You could check the PID file it should be present.
May help on a empty database. If there is something in the database you should do a backup first.
Best Answer
This splitting is pretty typical for most services. I'm on Fedora but most distributions do the same in terms of organizing files based on their type, into designated areas.
Taking a look at the Postgres SQL server:
/etc/
/usr/bin
/usr/lib64/pgsql/
/usr/share/locale/
/usr/share/
/var/lib/
The rational for having a libraries directory
usr/lib/postgresql
in your case, which is equivalent to/usr/lib64/pgsql/
for my install, is that applications can make use of libraries of functions that are provided by Postgres. These functions are contained in these libraries.So as an application developer, you could link against the libraries here to incorporate function calls into Postgres, into your application. These libraries will often times include API documentation, and the developers of Postgres make sure to keep their API specified and working correctly through these libraries, so that applications that make use of them, can be guaranteed that they'll work correctly with this particular version of Postgres.