Cannot install mySQL/maridDB on Debian 7 (Wheezy) - mysql

Stackoverflow.
I am struggling for a past couple of days to install mySQL on my raspberry pi 2 :/
I am not Debian 7 (Wheezy) and there is no way I can change the distribution, have to work with that. So, i need to install MySQL version 5.5 or greater, or MariaDB and i have tried installing both, but none works.
When installing MariaDB, following their documentation, when i get to the point
sudo apt-get install mariadb-server
Am getting an error:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.0 (= 10.0.32+maria-1~wheezy) but it is not installable
Tried googling and looking for similar cases, but can't find anything which would work.
With mySQL things are even worst. Using their documentation and MySQL APT Repository and tutorials doing following steps:
wget https://dev.mysql.com/get/mysql-apt-config_0.8.8-1_all.deb
dpkg -i mysql-apt-config_0.8.8-1_all.deb (choosing mysql 5.6)
apt-get update
It shows error:
apt-get update
Hit http://mirror.zol.co.zw wheezy Release.gpg
Hit http://mirror.zol.co.zw wheezy Release
Hit http://mirror.zol.co.zw wheezy/main Sources
Hit http://mirror.zol.co.zw wheezy/main amd64 Packages
Hit http://mirror.zol.co.zw wheezy/main i386 Packages
Ign http://mirror.zol.co.zw wheezy/main Translation-en_GB
Ign http://mirror.zol.co.zw wheezy/main Translation-en
Hit http://archive.raspberrypi.org wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release
Get:1 http://repo.mysql.com wheezy Release.gpg [173 B]
Hit http://archive.raspberrypi.org wheezy Release
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Get:2 http://repo.mysql.com wheezy Release [24.1 kB]
Get:3 http://repo.mysql.com wheezy/mysql-5.6 Sources [859 B]
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_GB
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Fetched 25.2 kB in 5s (4,900 B/s)
W: Failed to fetch http://repo.mysql.com/apt/debian/dists/wheezy/Release Unable to find expected entry 'mysql-apt-config/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.
And if i try:
apt-get install mysql-community-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql-community-server
Please help, any help would be very appreciated!

There doesn't seem to be any package in official debian repo in the name mysql-community-server. I found mysql-server package instead.
https://packages.debian.org/wheezy/mysql-server.
So try this:
Add official debian repo to your sources list (i.e. add deb http://security.debian.org/debian-security wheezy/updates main to the file /etc/apt/sources.list)
sudo apt-get update
sudo apt-get install mysql-server

Related

How can I install MySQL 5.7 on Ubuntu 22.04 LTS?

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

Mysql installation error (unmet dependencies)

I just wanted to re-install the mysql from my ubuntu. So i have purge the mysql but when i am trying to install it. It's show dependencies unmet error.
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-0ubuntu0.17.10.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
mysql-testsuite-5.7 : Depends: mysql-server-5.7 (= 5.7.22-0ubuntu0.17.10.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When i try to update it shows:-
sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu artful InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu artful InRelease
Hit:3 http://security.ubuntu.com/ubuntu artful-security InRelease
Err:4 http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu artful InRelease
403 Forbidden
Ign:5 http://archive.ubuntu.com/ubuntu trusty InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu artful-updates InRelease
Hit:7 http://archive.ubuntu.com/ubuntu trusty Release
Hit:8 http://de.archive.ubuntu.com/ubuntu artful-backports InRelease
Hit:9 http://ppa.launchpad.net/mutlaqja/ppa/ubuntu artful InRelease
Reading package lists... Done
E: Failed to fetch http://ppa.launchpad.net/canonical-kernel-team/pti/ubuntu/dists/artful/InRelease 403 Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.
When i try to fix dependency the problem we get is still the same:-
sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mysql-server-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.7
0 upgraded, 1 newly installed, 0 to remove and 105 not upgraded.
3 not fully installed or removed.
Need to get 3,189 kB of archives.
After this operation, 48.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 mysql-server-5.7 amd64 5.7.22-0ubuntu0.17.10.1 [3,189 kB]
Fetched 3,189 kB in 0s (14.9 MB/s)
Preconfiguring packages ...
(Reading database ... 158292 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.22-0ubuntu0.17.10.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
none of the fix works for me.
Thanks in advance :)
Happy coding
Seems your system is stuck in the process of mysql. Restart your system and run the following code.
sudo apt-get update
sudo apt-get -f install
sudo apt purge -y mysql-server
sudo apt install -y mysql-server
Then you should be prompted by the mysql installer to provide a password and it should work just fine.

Install Apache on Debian VPS & unmet dependencies error

I have a VPS and it runs on Debian GNU/Linux 8 (jessie). I try to install Apache, PHP, and MySQL on it. I get the below error:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
When I run apt-get -f install, i get below error:
Preconfiguring packages ...
(Reading database ... 39521 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.52-0+deb8u1_amd64.deb ...
Aborting downgrade from (at least) 10.0 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.52-0+deb8u1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have basic knowledge of Linux, so any suggestion or help. I search online and try to uninstall and remove and reinstall MySQL... but no luck.
from you error output i did a quick apt-cache search to see the version numbers of mysql-server
from what i seen you might have installed mariadb-server-10.0 installed instead of mysql-server
do a dpkg -l | grep mysql and look at the results. you could also try dpkg -l | grep server and look at that output also.
ADDED COMMENT-
did you remove the file that it's asking you to do?
if you need to have both db-servers running i would follow along with this
https://superuser.com/questions/1029228/mysql-and-mariadb-instances-on-the-same-server
if you don't need both dbs, then i would apt-get remove mariadb-.. from your server and then apt-get -f install to get mysql-server installed

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

Unable to install libjpeg-turbo8-dev on Ubuntu

I tried to install libjpeg-turbo8-dev like this.
feng#HP:~$ sudo apt-get install libjpeg-turbo8-dev
[sudo] password for feng:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
kde-l10n-engb libasn1-8-heimdal:i386 libasound2:i386 libasyncns0:i386
libaudio2:i386 libavahi-client3:i386 libavahi-common-data:i386
{***many packages***}
libxml2:i386 libxmu6:i386 libxrender1:i386 libxt6:i386
libxxf86vm1:i386 mysql-common openjdk-7-jre-lib
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
libjpeg-turbo8-dev
0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
1 not fully installed or removed.
Need to get 0 B/420 kB of archives.
After this operation, 1 219 kB of additional disk space will be used.
(Reading database ... 261347 files and directories currently installed.)
Unpacking libjpeg-turbo8-dev:amd64 (from .../libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/jmorecfg.h', which is also in package libjpeg-turbo-devel 1.3.0-3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libjpeg-turbo8-dev_1.3.0-0ubuntu1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
My Ubuntu is 13.10
I want to install libjpeg-turbo8-dev, because I want to install mysql-server and mysql-client. Thet depends on this package.
feng#HP:~$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libjpeg8-dev : Depends: libjpeg-turbo8-dev (>= 1.1.90+svn722-1ubuntu6) but it is not going to be installed
mysql-client : Depends: mysql-client-5.5 but it is not going to be installed
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
What you could try is to install the synaptic package manager:
sudo apt-get install synaptic
Here is someone who had a similar problem with the java runtime. Maybe this can help you if synaptic doesn't.
Otherwise I am not sure if you do really need the dev package...