Posted by on Jul 25, 2011 in Computers, Open Dental | 18 comments

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-server
sudo apt-get purge mysql-client
sudo apt-get purge mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

sudo rm -fr /var/lib/mysql

sudo 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

zv7qrnb

18 Comments

  1. 7-29-2011

    # 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

  2. 7-31-2011

    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!

  3. 8-2-2011

    Superb work!
    Was really helpful.

  4. 8-2-2011

    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

  5. 8-10-2011

    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.

  6. 8-10-2011

    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.

  7. 8-10-2011

    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.

  8. 8-12-2011

    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!

  9. 8-12-2011

    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*

    sudo /usr/sbin/mysqld --skip-grant &

    ******************

    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*

    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
  10. 8-17-2011

    I still get the security error when I add the double dash before skip-grant :-(

  11. 8-18-2011

    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.

  12. 8-18-2011

    Please, try:

    /usr/bin/mysqld_safe –user=mysql &
    /usr/bin/mysql_secure_installation

  13. 8-19-2011

    here is another that I found quite handy Install MySQL 5.5

  14. 9-1-2011

    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!

  15. 9-7-2011

    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.

  16. 9-8-2011

    Thanks, updated the code above to reflect this change

  17. 1-4-2012

    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!

  18. 1-4-2013

    I cannot run

    sudo alien -i MySQL-server-5.5.14-1.linux2.6.x86_64.rpm –scripts
    Please help me

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

jfb_p_buttontext