Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install MySQL 5.5.xx on Ubuntu
@ValentinMerlet

This comment has been minimized.

Copy link

@ValentinMerlet ValentinMerlet commented Jan 23, 2019

Thanks for this gist, you saved my day !

@YairPR

This comment has been minimized.

Copy link

@YairPR YairPR commented Apr 23, 2019

Thanks !!

@prabir09

This comment has been minimized.

Copy link

@prabir09 prabir09 commented Apr 25, 2019

Thanks for the gist.

@godfreymakori

This comment has been minimized.

Copy link

@godfreymakori godfreymakori commented May 7, 2019

Thanks. Saved the day while reinstalling a legacy system

@aonomike

This comment has been minimized.

Copy link

@aonomike aonomike commented Jun 8, 2019

can this be used for mysql 5.6 as well?

@noonedeadpunk

This comment has been minimized.

Copy link

@noonedeadpunk noonedeadpunk commented Jun 19, 2019

@leandromeira

This comment has been minimized.

Copy link

@leandromeira leandromeira commented Jun 28, 2019

You sir are a absolute legend for creating this. Flawless. Thank you very very much

@ahmadhasankhan

This comment has been minimized.

Copy link
Owner Author

@ahmadhasankhan ahmadhasankhan commented Jun 30, 2019

can this be used for mysql 5.6 as well?

Yes, it should work.

@cherrypj

This comment has been minimized.

Copy link

@cherrypj cherrypj commented Jul 16, 2019

Good stuff.

@Michael67780

This comment has been minimized.

Copy link

@Michael67780 Michael67780 commented Sep 3, 2019

Great! Thank you )

@luisdaher

This comment has been minimized.

Copy link

@luisdaher luisdaher commented Sep 12, 2019

Awesome gist. Thanks a lot!

@Mqleaf

This comment has been minimized.

Copy link

@Mqleaf Mqleaf commented Sep 28, 2019

Can it work for MySQL 5.6 on Ubuntu 18.04? @ahmadhasankhan

@derisrayan

This comment has been minimized.

Copy link

@derisrayan derisrayan commented Oct 10, 2019

Thank you Sir Ahmad (y)

@Nditah

This comment has been minimized.

Copy link

@Nditah Nditah commented Nov 11, 2019

Please correct step 9

sudo mv mysql-5.5.56-linux-glibc2.5-x86_64 mysql

@jasepulveda

This comment has been minimized.

Copy link

@jasepulveda jasepulveda commented Nov 25, 2019

excellent, thanks !!

@Ajorona

This comment has been minimized.

Copy link

@Ajorona Ajorona commented Nov 25, 2019

can this be used for mysql 5.6 as well?

support-files/my-medium.cnf will be support-files/my-default.cnf

@Ajorona

This comment has been minimized.

Copy link

@Ajorona Ajorona commented Nov 26, 2019

I can see that MySQL is up and running:

CGroup: /system.slice/mysql.server.service ├─732 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/loca…id └─939 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --dat…id

But, Command 'mysqld' not found

Can you advise on this? @ahmadhasankhan

@petrich

This comment has been minimized.

Copy link

@petrich petrich commented Jan 18, 2020

Great. Saved the day 👍

@docdeveloper

This comment has been minimized.

Copy link

@docdeveloper docdeveloper commented Jan 23, 2020

Thank you. These instructions got me what I needed.

@KevinBerthier

This comment has been minimized.

Copy link

@KevinBerthier KevinBerthier commented Mar 10, 2020

Thanks ! A lot !

@marcoschadu

This comment has been minimized.

Copy link

@marcoschadu marcoschadu commented Mar 11, 2020

I need the mysql 5.5 and in fact I managed to install it on Debian 10 and Ubuntu 18. However in both OS webmin (wich I unfortunately need) shows the myqsl correctly (5.5xxx) BUT as mariaDB database... Why is it? I didn't install mariaDB, just followed the steps describes above. Anyone could help me please? This happens with all debian and ubuntu versions, except Debian 8 and ubuntu 14 server, but both are pretty obsolete...

@le-yo

This comment has been minimized.

Copy link

@le-yo le-yo commented Apr 5, 2020

Thanks A lot

@nor5

This comment has been minimized.

Copy link

@nor5 nor5 commented Apr 8, 2020

I installed on ubuntu 18 and it works, thank you so match

@Malkom

This comment has been minimized.

Copy link

@Malkom Malkom commented Jul 15, 2020

Thanks man, you save my day !!!

@steffres

This comment has been minimized.

Copy link

@steffres steffres commented Jul 28, 2020

Thank you so very much!! You helped me immensely in getting a legacy mysql db running on UbuntuServer 20.04

A few small remarks however:

Is apt-get remove apparmor really necessary? In my case when I wanted to run it, apt said it would remove apparmor snapd and snapd seemed a bit too system-relevant to me, given how much Ubuntu now pushes towards snaps. Anyway, so I left it out and it worked fine as well.

And a little nitpicking perhaps, but for the sake of consistency with all the other very verbose steps, I suggest to also include the cd command in the step "Set mysql directory owner from outside the mysql directory" like:

cd ..
chown -R root .

and in the next one then:

cd mysql
chown -R mysql data

Again, excellent work and thank you!

Cheers!

@acosonic

This comment has been minimized.

Copy link

@acosonic acosonic commented Jul 30, 2020

Here is my askubuntu answer for mysql 5.7 done in a similar way...

https://askubuntu.com/a/1263423/513874

@chppppp

This comment has been minimized.

Copy link

@chppppp chppppp commented Jul 31, 2020

I am trying to perform this with mysql 5.5.47 on Debian 8 and i get this error. any suggestions? thanks!

$ sudo scripts/mysql_install_db.sh --user=mysql

FATAL ERROR: Could not find @bindir@/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
@ahmadhasankhan

This comment has been minimized.

Copy link
Owner Author

@ahmadhasankhan ahmadhasankhan commented Aug 3, 2020

I am trying to perform this with mysql 5.5.47 on Debian 8 and i get this error. any suggestions? thanks!

$ sudo scripts/mysql_install_db.sh --user=mysql

FATAL ERROR: Could not find @bindir@/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

Search the packages for my_print_defaults using

find / -name my_print_defaults

Check if my_print_defaults is missing on your system (which my_print_defaults), first find out which db is installed with:

dpkg -l |grep -E 'maria|mysql'|grep ii|grep server

@andreguipeil

This comment has been minimized.

Copy link

@andreguipeil andreguipeil commented Aug 7, 2020

Thank out man! It's works perfectly!

@felipebutcher

This comment has been minimized.

Copy link

@felipebutcher felipebutcher commented Aug 8, 2020

28 comments and no error. I think you are an angel fallen from sky.

@prashantnirgun

This comment has been minimized.

Copy link

@prashantnirgun prashantnirgun commented Aug 30, 2020

I have ubuntu 20 64 Bit I am getting error
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

can anyone help me please

I am using
uname -a
Linux lappy-b50-80 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@ehsanatwork

This comment has been minimized.

Copy link

@ehsanatwork ehsanatwork commented Sep 28, 2020

hello
thank you for your nice tutorial.
and it up and running.
but why it is showing the following error when i an giving the commang mysql --version

here is the error
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

@leoneDuarte

This comment has been minimized.

Copy link

@leoneDuarte leoneDuarte commented Sep 30, 2020

Ola esse Funcionou para min

Se der esse erro:
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

Esse comando resolve
apt-get install libncurses5

@madindo

This comment has been minimized.

Copy link

@madindo madindo commented Nov 5, 2020

got this working on ubuntu 20.04... you're my hero

@avi7611

This comment has been minimized.

Copy link

@avi7611 avi7611 commented Nov 10, 2020

which mysql-client version i need to install with this ?

@JTorres87

This comment has been minimized.

Copy link

@JTorres87 JTorres87 commented Dec 16, 2020

If anyone runs in to the error
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Simply install libncurses5
sudo add-apt-repository universe
sudo apt-get install libncurses5

You sir are a life saver and have made our lives easier. Thank You

@jascadev

This comment has been minimized.

Copy link

@jascadev jascadev commented Jan 20, 2021

Thank you very much for these instructions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment