How can I install MySQL 5.7 on Ubuntu 22.04 LTS? - mysql

The company I am working uses an older stack, and I need to install MySQL 5.7 on my Ubuntu 22.04 LTS to work on some projects locally. Does anyone knows how to do this? I just can't find anything besides installing it on Ubuntu 20.04 or lower.

download:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
dpkg -i mysql-apt-config_0.8.12-1_all.deb
select this options:
Bionic -> MySQL Server and Cluster -> mysql-5.7 -> ok
add key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
apt-get update
check available mysql versions:
apt-cache policy mysql-server
mysql-server:
Installed: (none)
Candidate: 8.0.27-0ubuntu0.20.04.1
Version table:
8.0.27-0ubuntu0.20.04.1 500
500 http://ru.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://ru.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
8.0.19-0ubuntu5 500
500 http://ru.archive.ubuntu.com/ubuntu focal/main amd64 Packages
5.7.37-1ubuntu18.04 500
500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages
and install it:
apt install -f mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7*
Done

I have fixed this issue for me with a small trick.What we actually need to do is edit our /etc/apt/sources.list with the source.list available in Ubuntu 20.4. eg. you will get an entry in ubuntu 22 "deb http://in.archive.ubuntu.com/ubuntu/ jammy main restricted"
so just replace jammy by bionic in all places in /etc/apt/sources.list then save and try apt update after then just simply try to install myslq sudo apt install -fmysql-server=5.7* can use this command and now you can able to install mysql successfully.
Once you are installed and mysql is up and running just make sure to revert the /etc/apt/sources.list file.
Reason for doing this is in Ubuntu 22.04 it is not bale to install all required dependencies for mysql5.7 so by editing source.list we allow to install all req dependencies.
Note: Don't use upgrade in while doing this all and make sure you revert the source.list file after myslq installed and plz mark mysql on hold for upgrade because whenever you run an upgrade command it will upgrade the mysql version to 8 from 5.
Hope this work for you. Thanks

Related

Can't install mysql 5.6 on elementaryos

I need LAMP on my elementaryos. I already have php, apache, and phpmyadmin.
Mysql has proven to be a problem to me. I've successfully installed mysql 5.7. Unfortunately, the people at mysql decided to add silly changes such as not being able to mysql -uroot -proot without sudo. Because of this change, I can't login via phpadmin with root.
So I've decided to just install mysql 5.6.
I've been following this guide.
Sadly, when I do apt-cache policy mysql-server, this is what I get:
mysql-server:
Installed: (none)
Candidate: 5.7.23-0ubuntu0.18.04.1
Version table:
5.7.23-0ubuntu0.18.04.1 500
500 http://ph.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://ph.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
5.7.21-1ubuntu1 500
500 http://ph.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 http://ph.archive.ubuntu.com/ubuntu bionic/main i386 Packages
The version is 5.7. So now the guide says check /etc/apt/sources.list.d/mysql.list. But this is what I have in there:
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-apt-config
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-5.6
deb http://repo.mysql.com/apt//ubuntu/ wily mysql-tools
deb-src http://repo.mysql.com/apt//ubuntu/ wily mysql-5.6
So it's actually correct. But it's still not 5.6.
Can anybody help me out?
1.In Software & Updates/Other Software added 14.04 repository:
deb http://archive.ubuntu.com/ubuntu trusty main
2.Installed mysql client and server:
sudo apt install mysql-server-5.6
sudo apt install mysql-client-5.6
Update: Before installing 5.6, make sure that no other mysql packages are present:
dpkg -l | grep mysql - returns list of mysql packages.
Use apt-get purge <package name> to purge them.
Source: 16.04 upgrade broke mysql-server

Not able to install mysql workbench on ubuntu 16.04

while installing MYSQL workbench from software center, the system shutdown due to a power cut.
After I powered it back up, when I try to install the workbench again, it does not install and when I try to install it from command line using
sudo apt-get install mysql-workbench
I get following error.
The following packages have unmet dependencies: mysql-workbench :
Depends: libgdal.so.1-1.11.3 Depends: libgdal1i (>= 1.8.0) but it is
not going to be installed E: Unable to correct problems, you have held
broken packages.
Please help to install it on ubuntu 16.04
I had the exact same problem. I was not able to install it using apt-get, but I had no problem doing so with the .deb file:
Go to mysql-workbench download site
Select Platform > Ubuntu Linux > Download
No thanks, just start my download.
Open the deb file downloaded
Click Install
I hope this works for you too.
https://dev.mysql.com/downloads/repo/apt/
Download apt repository
Select “No thanks, just start my download“
2)install sudo apt install ./mysql-apt-config_0.8.15-1_all.deb
3)During the installation, we will be prompted by dialog box,click ‘OK’ to continue MySQL Workbench installation.
4)update apt
sudo apt update
5)install workbench
sudo apt install mysql-workbench-community
6)To launch run mysql-workbench
list held packages : apt-mark showhold
then
get them out of held state: apt-mark unhold
then remove them. then try your main install again.
on Ubuntu 19
1)I had to preceding it on Ubuntu 19 also install manually a library libzip
https://ubuntu.pkgs.org/18.10/ubuntu-universe-amd64/libzip4_1.1.2-1.1_amd64.deb.html
2) then manually selecting on download page deb package for mysql workbench
https://dev.mysql.com/downloads/workbench/
then install deb packages via standard apt installer in Downloads dir
sudo apt install ./libzip4_1.1.2-1.1_amd64.deb
and downloaded workbench deb package
sudo apt install ./mysql-workbench-community_8.0.16-1ubuntu18.04_amd64.deb

mysql2 gem install fails with unmet dependencies: libmysqlclient-dev

I am experiencing a similar issue to this poster on the askubuntu forums. I've started with a clean Ubuntu 14.04 install several times now and keep getting the same error no matter what I do.
The following packages have unmet dependencies:
libmysqlclient-dev : Depends: libmysqlclient18 (= 5.5.46-0ubuntu0.14.04.2) but 10.0.23+maria-1~trusty is to be installed
E: Unable to correct problems, you have held broken packages.
Reproducing the error:
Followed the instructions on the MariaDB site for version 10.0. I tried 10.1 as well in a previous attempt.
I have Ruby (2.2.3) on Rails (4.2.5) installed on my server. Setup my app, configure the Gemfile and bundle install
An error occurred while installing mysql2 (0.4.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.4.2'` succeeds before bundling.
Then I gem install mysql2 -v '0.4.2' and get the following:
mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.
So I apt-get install libmysqlclient-dev and get the error Unable to correct problems, you have held broken packages as seen in the first part of this post.
Infos:
apt-cache policy libmysqlclient18 &
libmysqlclient18:
Installed: 10.0.23+maria-1~trusty
Candidate: 10.0.23+maria-1~trusty
Version table:
*** 10.0.23+maria-1~trusty 0
500 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu/ trusty/main amd64 Packages
100 /var/lib/dpkg/status
5.5.46-0ubuntu0.14.04.2 0
500 http://mirrors.digitalocean.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
5.5.35+dfsg-1ubuntu1 0
500 http://mirrors.digitalocean.com/ubuntu/ trusty/main amd64 Packages
What step am I missing that will get the bundle install to not encounter issues with the mysql2 gem (and still use MariaDB)? mysql -uroot -p works okay from the terminal.
purge all mysql related packages
sudo apt-get remove --purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
Now, that you have a clean system. Try installing mariadb again
sudo apt-get install mariadb-server libmariadbclient-dev mariadb-client mysql-common libmysqlclient18 libmariadbd-dev
just ensure that package version you are being promted to install are the same as given on this page:
http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/
Otherwise, it will install Mysql packages from Ubuntu's official repo which will cause the conflict.If that happens, you should set maria db repo with higher priority as given on this page:
https://askubuntu.com/questions/293619/assign-higher-priority-to-ppa
Hope it helps

PHPAdmin on Redhat 6.4

I'm try into install the latest PhpMyAdmin into the Redhat 6.4 and I can't get it working and getting dependencies error, I'm try install through YUM REMI and other file repo, all I can get it working is the old version 2.11 which is very old.
I manually downloaded the Phpadmin 4.xx. RPM and using Yum localinstall and still not working.
The box is running PHP 5.6.9 and MySQL Server 5.6.22-log
Anyone have any idea?
Usually it gets to work if we do the following as preliminary steps
Firstly clean your metadata: This cleans up any xml metadata that may have been cached from any enabled repository
$ sudo yum clean metadata
Then upgrade all of your system software to the latest version
$ sudo yum update
But, if you have installed PHP 5.6.9 from remi repository, then need to check the phpmyadmin version compatibility with php from remi repository. Do not downgrade php if there is a mismatch. In that case try this
yum --enablerepo=remi install phpmyadmin
If you get package not found
The EPEL repo contains the phpMyAdmin package we are looking for.
sudo yum install epel-release
Once EPEL is done try
sudo yum install phpmyadmin
For reference:
http://www.if-not-true-then-false.com/2012/install-phpmyadmin-on-fedora-centos-red-hat-rhel/
http://www.krizna.com/centos/how-install-phpmyadmin-centos-6/

Downgrade Mysql 5.5.9 to 5.1 on Ubuntu 14.04

After upgrading to Ubuntu 14.04 Mysql 5.5.9 is incompatible with some of my scripts. I need to re-install Mysql 5.1. I tried research online but no luck
When I do
apt-get install mysql-server-5.1 mysql-client-5.1
Package mysql-server-5.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mysql-server-core-5.5:i386 mysql-server-5.5:i386 mysql-server-core-5.5
mysql-server-5.5
E: Package 'mysql-server-5.1' has no installation candidate
E: Package 'mysql-client-5.1' has no installation candidate
Tried to find multiverse source but no luck,
Anyone?
Uninstall existing mysql
sudo apt-get remove mysql-server
Download the MySQL APT repository config tool (as root)
wget http://dev.mysql.com/get/mysql-apt-config_0.3.5-1debian8_all.deb
Install the MySQL APT repository config tool
dpkg -i mysql-apt-config_0.3.5-1debian8_all.deb
Update APT
apt-get update
Install the server
apt-get install mysql-community-server
Thereby you can select the server you need and install