How to restart MySQL/MariaDB service
Replace mysql with mysqld for RedHat-based platforms.
Ubuntu 16.10 and later, RedHat/CentOS 7 and later, fedora and other platform with systemd
sudo systemctl restart mysql.service
Older platforms with System V init scripts
sudo /etc/init.d/mysql restart
Platforms with service command. Normally a wrapper to System V init scripts or systemd commands.
sudo sudo service mysql restart