3

I wanted to install MySQL with sudo apt mysql-server but it is obsolete, so use sudo apt default-mysql-server, I installed by default MariaDB.

I didn’t try another package installer, I’m new to Linux. So, I wanted to know how I can check when a program is obsolete and how I can install MySQL 8.

2 Answers 2

1

The question on how to install it has already been answered, so I will answer the cons and pros of MySQL and MariaDB, and how to install either one.

How to install MySQL.

This has already been answered, but I might as well include it here.

You can install MySQL via the APT repository. To install the repository:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb

To actually install MySQL server:

sudo apt update
sudo apt-get install mysql-server

To install MariaDB.

Install the APT repo, just like MySQL

curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash

Then actually install MariaDB:

sudo apt-get install mariadb-server mariadb-client mariadb-backup

Differences between MySQL and MariaDB.

According to this website:

“MariaDB has a significantly high number of new > features, which makes it better in terms of performance > and user-orientation than MySQL.”

Basically, MariaDB is a drop-in replacement for MySQL and here’s a table of all the differences:

MySQL MariaDB
Released in 1995 Released in 2009
Not a drop-in replacement for MariaDB Drop-in replacement for MySQL
Proprietary code is accessible in MySQL Enterprise. Proprietary code isn’t accessible.
MySQL has 1600 forks. MariaDB has 868 forks.
Server supports Windows, Linux, FreeBSD, Solaris, and OS X Supports the same as MySQL.
Can handle large amounts of data without becoming unstable
Cannot handle large amounts of data.

In my opinion , you don’t have to take my opinion, but I think MariaDB is a better choice than MySQL.

Update: A user in the comments pointed out some flaws, their comment states:

Your general assumption on MariaDB makes sense in basic situations, but in cases where large data comes into play, like more than 500,000 to millions of rows of data, MariaDB shows it’s flaws. MySQL is far more stable and refined and works great! I have had to upgrade many servers from MariaDB to MySQL for this reason. And the main reason people use MariaDB is to avoid possible licensing issues that honestly almost never come into play.

I have not fact checked any of these claims, but am including them here in case.

3
  • 1
    Ah, well, ok. I will just update the answer. That was just my opinion, however.
    – Samuel
    Commented Feb 7, 2022 at 20:51
  • But from what I have seen in the works they ask a lot for MySQL.
    – playero
    Commented Feb 17, 2022 at 2:52
  • @playero Apologies, but I am confused at your question. Could you rephrase it?
    – Samuel
    Commented Feb 23, 2022 at 18:03
1

You need to add the MySQL APT Repository (check there for the latest version number):

wget "https://repo.mysql.com//mysql-apt-config_0.8.28-1_all.deb"
sudo dpkg -i mysql-apt-config_0.8.28-1_all.deb

Select OK, Tab then Enter. Then run:

sudo apt update
sudo apt install mysql-server
3
  • This is a great answer but are you SURE you want MySQL and not MariaDB? Commented Feb 7, 2022 at 19:59
  • Also, make sure you purge any old MariaDB installation, or you won't be able to run the service successfully, getting An ExecStart= process belonging to unit mysql.service has exited :)
    – Pablo A
    Commented Nov 7, 2023 at 23:54
  • This doesn't work for me, because i get key errors and that completely blocks the apt package manager from working. I've tried several instructions for adding the keys, but in 4-5 attempts, it simply hasn't worked.
    – Owl
    Commented Apr 29 at 22:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .