Debian / Ubuntu using System V init scripts:
- apt-get install default-mysql-server
- [If the above fails, try apt-get install mysql-server instead]
- service mysql stop
- rm /var/lib/mysql/ib_logfile*
Debian / Ubuntu using systemd:
- apt-get install mysql-server mysql-client
- systemctl stop mysql.service
- rm /var/lib/mysql/ib_logfile*
Devuan:
- apt-get install mysql-server mysql-client
- service mysql stop
- rm /var/lib/mysql/ib_logfile*
CentOS 7:
- yum -y install mariadb-server
CentOS 8 and later or Rocky Linux:
- dnf install -y mysql-server
Others:
- yum -y install mysql-server
Note that on some recent distributions, such as Fedora 20 or later, installing mysql will actually install mariadb.