Home > Software engineering >  How to Install MySQL Version 5.7 in Ubuntu 22.04
How to Install MySQL Version 5.7 in Ubuntu 22.04

Time:06-29

I am trying to install MySQL version 5.7 in Ubuntu 22.04. Every time I try installing that, the error is showing as Could not find the package for Ubuntu 22.04. But I can install MySQL 8 successfully and it is working as well. Can anyone who is well versed with the problem help me here. I have tried lots and lots of tutorials but seems like none of them work out.

CodePudding user response:

You could run it in a container

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7

CodePudding user response:

Mysql 5.7 is not available to the Ubuntu 20.04. Only mysql 8.0 and higher version are available to Ubuntu 20.04 when you use mysql repository. Here you are using bionic source list (Ubuntu 18.04) for Ubuntu 20.04. I believe this workaround sometimes causes messup with dependencies tree.

You need to download mysql 5.7 packages with their dependencies from [a link] (https://dev.mysql.com/downloads/mysql/5.7.html)! and install manually by executing below command in terminal.

sudo dpkg -i <package name>

CodePudding user response:

Step 1: Add MySQL APT repository in Ubuntu.

Step 2: Update MySQL Repository on Ubuntu.

Step 3: Install MySQL 5.7 on Ubuntu 20.04 Linux machine.

Step 4: Secure MySQL 5.7 Installation on Ubuntu 20.04.

Step 5: Check MySQL 5.7 version on Ubuntu 20.04

Step 6: Create MySQL User (Optional, testing only)

Step 7: Enable MySQL remote access (Optional)

Source code : https://computingforgeeks.com/how-to-install-mysql-on-ubuntu-focal/

  • Related