I have been beating my head against the wall for almost a year now, trying to figure out how to install MySQL 5.5 on Ubuntu since there is still not a .deb package to use. OpenDental software makes use of MySQL as it’s database and since my servers have always run Ubuntu, I didn’t really want to switch to an RPM based distro and have to learn new tricks for that system just for this reason. MySQL 5.1 was giving off and on errors and the time had come that I to either get it to work or ditch Ubuntu for and RPM based distro (probably OpenSuse/Fedora/Mandriva).
Finally, after trying it seems like twenty or thirty tutorials on the net and having problem at one point or another with all of them, I succeeded and got MySQL 5.5.14 running on Ubuntu 11.04 “lucid!”
If you follow the steps below from a standard Ubuntu/MySQL LAMP server install, you should be able to have a working v5.5 server in no time!
(help from this thread: https://code.launchpad.net/~clint-fewbar/ubuntu/natty/mysql-5.1/mysql-5.5-packaging)
64bit Machine w/ MySQL 5.5.14
sudo apt-get purge mysql-serversudo apt-get purge mysql-clientsudo apt-get purge mysql-commonsudo apt-get autoremovesudo apt-get autocleansudo rm -fr /var/lib/mysqlsudo wget -O MySQL-server-5.5.14-1.linux2.6.x86_64.rpm http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.14-1.linux2.6.x86_64.rpm/from/http://mysql.mirrors.hoobly.com/
sudo wget -O MySQL-client-5.5.14-1.linux2.6.x86_64.rpm http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.14-1.linux2.6.x86_64.rpm/from/http://mysql.mirrors.hoobly.com/
sudo apt-get install alien
sudo alien -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm --scripts
sudo alien -i MySQL-client-5.5.14-1.linux2.6.x86_64.rpm --scripts
sudo apt-get install libaio1 libaio-dev
sudo /usr/sbin/mysqld --skip-grant &sudo /etc/init.d/mysql start
If you want to secure the installation and put a password on the root user:
/usr/bin/mysql_secure_installation
# mysql_install_db
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)
# chown -R mysql.mysql /var/lib/mysql
sudo chown mysql:root /var/lib/mysql/ -R
sudo chmod g+rw /var/lib/mysql/ -R
sudo /usr/sbin/mysqld –skip-grant &
Remember: don’t install MySQL as root!
Superb work!
Was really helpful.
I did the installation but I don’t have my.cnf
Do you have the default one?
God Bless you for the time expend in this
These instructions were great, except I obviously messed something up, probably from being lazy. I ran these as root instead of sudo-ing everything and now when I do this:
sudo /usr/sbin/mysqld -skip-grant &
I get this error:
110810 16:04:54 [ERROR] Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root!
So I obviously made a big mistake, and now I have to somehow undo it or set permissions somewhere. I’m just so screwed right now because I have no database on my machine and I might have to go back and reinstall 5.1 using the Ubuntu package manager and start over. but how would I undo what I just did with these instructions?
Thanks so much if you have any answers.
Ok, I got it uninstalled with the Synaptic Package Manager. I have a question – where is the equivalent of the “common” stuff that you get in 5.1 through apt-get? I am going to try this again real quick and see if it will work.
Honestly, I am not sure what all the “common” programs are in the 5.1 package, but it works fine on mine without them except for whatever is installed using ALIEN.
Same error as Donna. Followed steps exactly with a fresh install of 11.04.
I setup root so I can login as room and tried to start mysqld. Starting MySQL
… * The server quit without updating PID file (/var/lib/mysql/edautomate-mysql.pid).
sudo /usr/sbin/mysqld -skip-grant &
I get this error:
110810 16:04:54 [ERROR] Fatal error: Please read “Security†section of the manual to find out how to run mysqld as root!
you don’t need to run mysql as root, just use the sudo command as described in the install. I figured out what was wrong. WordPress reformatted my text and the double dash “- -” was dropped in front of the offending line to one dash. Try it now and see if it doesn’t work.
sudo /usr/sbin/mysqld -skip-grant &
*should be*
******************
Also the Alien lines were affected with a double dash before script:
sudo alien -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm –script
sudo alien -i MySQL-client-5.5.14-1.linux2.6.x86_64.rpm –script
*should be*
I still get the security error when I add the double dash before skip-grant 🙁
Simon, are you installing as root? Because I had the same thing. When I tryied to set root permissions to mysql, works great.
sudo chown mysql:root /var/lib/mysql/ -R
sudo chmod g+rw /var/lib/mysql/ -R
sudo /usr/sbin/mysqld –skip-grant &
Later, I tryed create other user to install, and works great too.
Please, try:
/usr/bin/mysqld_safe –user=mysql &
/usr/bin/mysql_secure_installation
here is another that I found quite handy Install MySQL 5.5
I get a bunch of insserv: xxxx error messages, wenn I run this with MySQL-server-5.5.14-1.linux2.6.i386.rpm (this is correct because I don’t have a 64 Bit Installation of Ubuntu 11.04).
After sudo /usr/sbin/mysqld –skip-grant &
I get:
Please read “Security” section of the manual to find out how to run mysqld as root!
110901 21:55:59 [ERROR] Aborting
110901 21:55:59 [Note] /usr/sbin/mysqld: Shutdown complete
After sudo /etc/init.d/mysql start
I get:
Starting MySQL
… * The server quit without updating PID file (/var/lib/mysql/ubuntu.pid).
I am not a linux professional. Thanks for Your help!
Please note the Alien lines should actually be:
sudo alien -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm –scripts
sudo alien -i MySQL-client-5.5.14-1.linux2.6.x86_64.rpm –scripts
The missing ‘s’ on the –scripts argument causes the install to hang. This has cause me several hours of pain in figuring out.
Thanks, updated the code above to reflect this change
I used this command ->
sudo ./mysql_install_db –datadir=/usr/local/mysql/data –basedir=/usr/local/mysql/ –user=mysql
And i got this error….Can anyone please suggest me how to overcome this problem????
Installing MySQL system tables…
connect: Connection refused
Installation of system tables failed! Examine the logs in
/usr/local/mysql/data for more information.
You can try to start the mysqld daemon with:
shell> /usr/local/mysql//bin/mysqld –skip-grant &
and use the command line tool /usr/local/mysql//bin/mysql
to connect to the mysql database and look at the grant tables:
shell> /usr/local/mysql//bin/mysql -u root mysql
mysql> show tables
Try ‘mysqld –help’ if you have problems with paths. Using –log
gives you a log in /usr/local/mysql/data that may be helpful.
Please consult the MySQL manual section
‘Problems running mysql_install_db’, and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before mailing us! And remember, if
you do mail us, you MUST use the /usr/local/mysql//scripts/mysqlbug script!
I cannot run
sudo alien -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm –scripts
Please help me