A step by step guide to upgrading to MySQL 5.5

MySQL 5.5 has created a lot of hype and its not just hype, there are major performance enhancements not only in the MySQL server itself but in the newer InnoDB plugin shipped with MySQL 5.5. That’s exactly the reason why I have myself upgraded to MySQL 5.5 (The server running this blog run MySQL 5.5). Now since I haven’t come across a guide to help in upgrading to MySQL 5.5, I thought why not make one myself. So here goes nothing!

Download the binary

$ cd /root/
$ wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.11-linux2.6-i686.tar.gz/from/http://mysql.llarian.net/
$ mv index.html mysql-5.5.8-linux2.6-i686.tar.gz

Backup the MySQL configuration

$ mkdir /root/mysql-5.1-conf
$ cp -R /etc/mysql/ /root/mysql-5.1-conf

Backup the data directory

We will be backing up the data in the form of SQL dump as well as by copying the data files over to a safe place, just to be 100% sure about the data not getting lost.

$ mkdir /root/mysql-5.1-data
$ cp -R /var/lib/mysql/ /root/mysql-5.1-data

Backup the data as SQL dump

Backup the mysql database separately and not with all the other databases, because we are going to need it before we restore all the databases.

$ mkdir /root/mysql-5.1-dump
$ mysqldump -u user_name -p --databases mysql > /root/mysql-5.1-dump/mysql.sql
$ mysqldump -u user_name -p --databases db_name > /root/mysql-5.1-dump/db_name.sql

Install the asynchronous I/O library

This is so that we can take advantage of the asynchronous I/O capability in the new InnoDB plugin that ships with MySQL 5.5

$ apt-get install libaio-dev

Untar the archive

$ tar xzvf mysql-5.5.8-linux2.6-i686.tar.gz

Copy or move the untarred MySQL directory to the installation directory

$ cp -R mysql-5.5.8-linux2.6-i686 /usr/local/
$ cd /usr/local/
$ ln -s mysql-5.5.8-linux2.6-i686 mysql

Remove the older version of MySQL

Now is the time to remove the older version of MySQL, in this case I assume the older version to be MySQL 5.1

$ apt-get remove mysql-server-5.1
$ apt-get autoremove
$ apt-get remove mysql-client
$ apt-get autoremove

Add the path to MySQL bin directory to the PATH variable

$ vim /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/mysql/bin"

Set the correct file and directory permissions on the MySQL installation directory

Setting correct permissions is very important, make sure that all the files except those under the data directory are owned by root. The data directory has to be owned by the user mysql.

$ cd /usr/local/mysql
$ chown -R mysql:mysql data

Create the socket directory

Here again, setting the correct permissions on the socket directory is very important, otherwise MySQL would not run.

$ mkdir /var/run/mysqld/
$ chown -R mysql:mysql /var/run/mysqld/

Copy the sample MySQL configuration file to the etc directory and setup the paths

$ cd /usr/local/mysql/support-files/
$ cp my-large.cnf /etc/my.cnf

Now edit /etc/my.cnf so that it has the following values:

user            = mysql
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr/local/mysql
datadir         = /usr/local/mysql/data
tmpdir          = /tmp
log_error       = /var/log/mysql/error.log

Copy the MySQL server startup script to the startup directory

The MySQL startup script has to be placed in the directory where all the startup scripts reside, so that MySQL starts on system startup. Make sure that you make the startup script executable, and update the rc.d database to notify the system about the presence of a new startup script.

$ cd /usr/local/mysql/support-files/
$ cp mysql.server /etc/init.d/mysql
$ chmod +x /etc/init.d/mysql
$ update-rc.d mysql defaults

Remove the MySQL files from the older version

Make sure you don’t delete files belonging to the new version we are installing.

$ rm -R /var/lib/mysql
$ rm -R /etc/mysql
$ rm -R /usr/lib/mysql

When starting the MySQL server for the first time after the new installation, it has to be started without the grants table, for two reasons. Firstly, because we want to retain the users and privileges data from the previous install of MySQL and secondly, because the schema of the grants table in MySQL 5.5 has changed.
So what we will do is start MySQL without the grants table, import the users and privileges data we backed up earlier in this guide and run the mysql_upgrade script that modifies the schema of the grants table to be in sync with that in MySQL 5.5. After that we will be able to run MySQL normally and have all the users and privileges same as in the previous version we had.

Start MySQL server without grants table.

$ mysqld --skip-grant-tables --user=mysql

Load the MySQL users and privileges data we backed up earlier

$ cd /root/mysql-5.1-backup/dump/
$ mysql < mysql.sql

Run the upgrade script so that everything gets upgraded to the version 5.5

$ mysql_upgrade

Stop the server and start it normally

$ /etc/init.d/mysql stop
$ /etc/init.d/mysql start

There you go, you have a MySQL 5.5 server up and running in no time! Do share your thoughts if you try out MySQL 5.5

UPDATE: This article is translated to Serbo-Croatian language by Anja Skrba from Webhostinggeeks.com.

  • http://topsy.com/www.ovaistariq.net/490/a-step-by-step-guide-to-upgrading-to-mysql-5-5/?utm_source=pingback&utm_campaign=L2 Tweets that mention A step by step guide to upgrading to MySQL 5.5 | ovais.tariq — Topsy.com

    [...] This post was mentioned on Twitter by Boris Barroso. Boris Barroso said: A step by step guide to upgrading to MySQL 5.5 | ovais.tariq http://icio.us/Oi5MCJ [...]

  • http://mysql.darmowe-blogi.pisz.pl/bez-kategorii/a-step-by-step-guide-to-upgrading-to-mysql-5-5-ovais-tariq.html A step by step guide to upgrading to MySQL 5.5 | ovais.tariq | mysql

    [...] artykuł na: A step by step guide to upgrading to MySQL 5.5 | ovais.tariq 5-5-has, exactly-the, exactly-the-reason, have-myself, hype-and, its-not, major-performance, [...]

  • http://nulleds.webscriptgenie.com/?p=37750 A step by step guide to upgrading to MySQL 5.5 | ovais.tariq « Nulled Web Scripts

    [...] post: A step by step guide to upgrading to MySQL 5.5 | ovais.tariq :and-update, make-the-startup, notify-the, starts-on-system, startup, system-startup-, the-rc-d, [...]

  • http://www.php5webhosting.net/how-install-apache2-php5-mysql-phpmyadmin-ubuntu-10-10/ [How] Install Apache2, Php5, Mysql, PhpMyAdmin Ubuntu 10.10 | PHP5 Web Hosting

    [...] A step by step guide to upgrading to MySQL 5.5 | ovais.tariq [...]

  • http://wpvideotutorials.org/75759/niche-wordpress-blog-in-just-a-few-minutes-with-the-socrates-theme-3/ Niche Wordpress Blog In Just A Few Minutes With The Socrates Theme! – Wordpress Video Tutorials

    [...] A step by step guide to upgrading to MySQL 5.5 | ovais.tariq [...]

  • http://wpvideotutorials.org/76401/2803-le-blog-web-2-0-internet-et-technologies/ 2803, le blog web 2.0, Internet et technologies – Wordpress Video Tutorials

    [...] A step by step guide to upgrading to MySQL 5.5 | ovais.tariq [...]

  • Anonymous

    This is great, thanks, I now have a running installation of MySQL 5.5. But did you recompile php and Apache to match? Is there any way around this? Thanks!

  • http://www.ovaistariq.net/ Ovais Tariq

    No I didn’t have to recompile php and Apache and they are running absolutely fine,. I have apache 2.2 and php 5.3.2 installed.,

    are you facing any issues??

  • http://www.brcworld-barnim.de/?p=1046 Webprogrammierung & Design » Blog Archive » Diy Web Pack : Do It Yourself Web Design

    [...] A step by step beam to upgrading to MySQL 5.5 | ovais.tariq [...]

  • http://twitter.com/fantasyonline Fantasy Online

    I get to:
    mysqld –skip-grant-tables –user=mysql

    And it hangs. Latest Ubuntu.

  • m2pc

    When I get to the part:
    mysqld –skip-grant-tables –user=mysql

    I get the following errors/warnings:

    101221 12:07:41 [Warning] Can’t create test file /var/lib/mysql/updatepromise2.lower-test
    101221 12:07:41 [Warning] Can’t create test file /var/lib/mysql/updatepromise2.lower-test
    mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 2)
    101221 12:07:41 [ERROR] Aborting

    101221 12:07:41 [Note] mysqld: Shutdown complete

    Any ideas?

  • Gunderjj

    I noticed you download the 32 bit version. That is great because the initial install I plan to do is on a 32 bit dev server, but all other servers we have are 64 bit. I dont even see a 64 bit version on oracles site? Do you know when one will be available?

  • Gunderjj

    nevermind, found it.

  • http://www.facebook.com/jmpaz Jose M. Paz

    I have the same problem in ubuntu 10.10 64

  • m2pc
  • Anonymous

    that just means that the server is running… you need to execute subsequent steps in another console/terminal, or add ‘&’ to fork the mysqld process to the background. When you use init.d scripts to stop and then start it again, this ‘skip-grant-tables’ mysqld process will terminate.

  • Anonymous

    this one sounds like you haven’t got the correct settings in /etc/my.cnf, or similar. Did you complete the instruction under “Copy the sample MySQL configuration file to the etc directory and setup the paths” ?

  • Anonymous

    no, just getting warnings about the client version being different from the server, and the danger of unpredictable results. I suspect it will probably be fine, but I’m not 100% comfortable with it, that’s all. I’m currently in the process of testing numerous projects to see if I can install MySQL 5.5 this way on a production server. If I find any problems, I’ll post here :)

  • http://www.ovaistariq.net/ Ovais Tariq

    Sure sure you can let me know if you face any problems,. But I do have MySQL 5.5 running on a production server,. Btw which client library are you using,. mysql or mysqli?

  • http://www.ovaistariq.net/ Ovais Tariq

    Well actually that doesn’t mean that the server hangs., actually mysql server is running but its not running as a background process thats why it doesn’t give back control to the terminal,. All you have to do now is open up another terminal and run the remaining steps on that.

    Thanks for asking this question,. I will mention it in this post,.

  • Anonymous

    lol – don’t worry, I didn’t mean support requests, more that I’d give you a heads-up if I found a problem :) I’m using mysqli, btw, but I notice that the recommended default with MySQL 5.5 is mysqlnd – this is another reason why I’m tempted to recompile the whole stack. Have any thoughts on that?

  • http://www.ovaistariq.net/ Ovais Tariq

    Do exactly as wilo108 has replied,.

  • http://www.ovaistariq.net/ Ovais Tariq

    Its good you found it., have you tried installing it,.

  • http://www.ovaistariq.net/ Ovais Tariq

    lol., well i have no issues with support requests,.

    Well mysqlnd is actually a new version/replacement of the old client library used by mysql, mysqli and pdo_mysql.

    mysqlnd ships with PHP 5.3 so, if you are using PHP 5.3 then it actually means that you are using mysqlnd behind the scenes.,

    mysqlnd shouldnt be confused with mysql or mysqli., mysql and mysqli are php extensions while mysqlnd is the library used by these two extensions on the internal C level,.

  • Anonymous

    ahh – I appreciate the distinction, thanks for making that clearer to me.

  • Céd

    Thx for this nice post.

    I can see this in the mysql documentation (http://dev.mysql.com/doc/refman/5.5/en/upgrading-from-previous-series.html) :
    “To upgrade to 5.5 from any previous version, MySQL recommends that you dump your tables with mysqldump before upgrading and reload the dump file after upgrading. ”

    I think you must reload all your data after a 5.5 upgrade via mysqdump if you use the new barracuda file format with innodb_file_per_table option.

    What do you think about that ?

  • Céd
  • http://www.ovaistariq.net/ Ovais Tariq

    That’s exactly what I have done in this guide,. check out the section “Backup the data as SQL dump”

  • Jean

    I am currently running MySQL 5.0.22, can I follow these instructions?

  • http://www.ovaistariq.net/ Ovais Tariq

    Yes you can,. but of course where ever I have used “mysql 5.1″ change it to “mysql 5.0″

  • Stuart B

    Any ideas when PHP-FPM will support MySQL 5.5 ? At the moment I have installed PHP-FPM and it still shows MySQL 5.1 after the upgrade.

  • http://www.ovaistariq.net/ Ovais Tariq

    Which version of PHP are you using??
    PHP 5.3.3 comes bundled with PHP-FPM,. and also includes mysqlnd which is the new library used by mysql clients,. may be try that.,

    are you seeing mysql 5.1 in the phpinfo output??

  • Ruralhunter

    I’m getting this when I run “mysqld –skip-grant-tables –user=mysql”:
    “mysqld” is already included in:
    * mysql-server-core-5.1
    * mysql-cluster-server-5.1
    Pls try:apt-get install

  • John

    @Ruralhunter: you need to get the updated path from /etc/environment:
    $ source /etc/environment

    Also, I installed 64 bit version, needed to:
    $ cp /usr/local/mysql/share/english/errmsg.sys /usr/share
    before server would start

  • Ruralhunter

    Hi John,
    thanks. Yes I fixed it by adding mysql/bin into my path. I did updated the path in /etc/environment and re-login but it doesn’t work. btw, I also installed the 64 bits version on 10.10 64 bits server. But I didn’t do the errmsg.sys step as you mentioned. Now my mysql is working fine. thanks again though!

  • http://pulse.yahoo.com/_7MOKQBK44A5AY4IZP4HNHY4V4M Bob

    Im getting the same thing and I have

    # The following options will be passed to all MySQL clients
    [client]
    user = mysql

    # Here follows entries for some specific programs

    # The MySQL server
    [mysqld]
    socket = /var/run/mysqld/mysqld.sock
    port = 3306
    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 1M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    # Try number of CPU’s*2 for thread_concurrency
    thread_concurrency = 8
    basedir = /usr/local/mysql
    datadir = /usr/local/mysql/data
    tmpdir = /tmp
    log_error = /var/log/mysql/error.log

    Is it correct?

  • http://www.ovaistariq.net/ Ovais Tariq

    This looks more like a paths issue,.

    According to the configuration you have posted and in my article mysql 5.5 will be installed in “/usr/local/mysql”., while the error you have posted points to “/var/lib/mysql/”.,, so check out that you have followed this article as is.,

    Or if you have installed mysql in “/var/lib/mysql/” then make sure you have provided the right permissions and also make sure you change the paths in my.cnf,.

    I suggest you go through my article again,.

  • http://twitter.com/wagnerbianchijr Wagner Bianchi

    Don’t you forget to add -R option to mysqldump when you have Stored Procedures in your database. If this option was omitted, you’ll have a big surprise after restore your backup file.

  • Nlinhting

    I got this warning in phpMyAdmin: “Your PHP MySQL library version 5.1.49 differs from your MySQL server version 5.5.8″. May this be problem, and how can I upgrade my PHP MySQL library version to match with it?

  • http://www.ovaistariq.net/ Ovais Tariq

    Which version of PHP are you using??

    Guys at MySQL have created a new client library “mysqlnd”,. that comes bundled with PHP 5.3 and powers mysql, mysqli and PDO_MYSQL.

    More details about how you can get “mysqlnd” is contained in the following url:
    http://dev.mysql.com/downloads/connector/php-mysqlnd/

  • Nlinhting

    Thanks, My PHP version is 5.3.3

  • Nlinhting

    could I get latest source code of PHP to complile & install on my ubuntu to have mysqld?

  • Nlinhting

    could I get latest source code of PHP to complile & install on my ubuntu to have mysqld?

  • http://www.ovaistariq.net/ Ovais Tariq

    since you are using PHP 5.3 so you already have the latest client library for use wtih MySQL., so don’t be concerned about the warning,.

  • http://www.ovaistariq.net/ Ovais Tariq

    The version of PHP that you have installed., did you compile from source or did you install using a binary.,

  • Sonyasmoke

    I am just about to issue the upgrade command. If this works, this is a great post.

  • Sonya

    It does work! Charming man

  • Anon

    I’m getting an error when trying to issue /etc/init.d/mysql start and the error is:

    * The server quit without updating PID file (/usr/local/mysql/data/ubuntu.pid).

    error.log indicate two errors:

    [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
    – but I did already…

    [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

    Any ideas?

  • Anon

    Ah…forget it…I just logged into phpmyadmin and it says that the mysql server version is 5.1.49-lubuntu8.1. This tutorial is inaccurate, and it sucks as I had to fix a few errors in the steps. Don’t waste your time people. This tutorial is flawed.

  • Anonymous

    lame, dude – don’t blame the tutorial ‘cos you screwed up….

  • http://www.ovaistariq.net/ Ovais Tariq

    Thanks for your kind compliments,.

  • James

    This looks like a very good tutorial. Can someone shoot me the link for the 64 bit source. I try to get it from mysql and it just stays the file you are downloading is mysql-5.5.4-m3-linux2.6-x86_64.tar.gz then it says I need to select a mirror and no mirrors are showing. Could some one save me some time and just shoot me a link.

  • James

    Sorry for the post I found the file I need. I do have one question… Which one will I need mysql-5.5.8-linux2.6-ia64.tar.gz or mysql-5.5.8-linux2.6-x86_64.tar.gz? I installed the amd install for ubuntu server at the time I was using an intel and was told that the amd installer works for both intel and amd. Since I have upgraded to the 6 core amd processor. Is this the same with mysql? I assum I would install mysql-5.5.8-linux2.6-x86_64.tar.gz as the other is for intel. Is this correct?

  • James

    Ok I decided to install mysql-5.5.8-linux2.6-x86_64.tar.gz and when I run mysqld –skip-grant-tables –user=mysql, I get this error:

    110125 16:24:24 [Warning] Can’t create test file /var/lib/mysql/tgcserv.lower-test
    110125 16:24:24 [Warning] Can’t create test file /var/lib/mysql/tgcserv.lower-test
    mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 2)
    110125 16:24:24 [ERROR] Aborting

    110125 16:24:24 [Note] mysqld: Shutdown complete

    Here is my.cnf:
    [client]
    #password = your_password
    user = mysql
    port = 3306
    socket = /var/run/mysqld/mysqld.sock

    # Here follows entries for some specific programs

    # The MySQL server
    [mysqld]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock
    basedir = /usr/local/mysql
    datadir = /usr/local/mysql/data
    tmpdir = /tmp
    log_error = /var/log/mysql/error.log
    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 1M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    # Try number of CPU’s*2 for thread_concurrency
    thread_concurrency = 8

    I dont understand what I am doing wrong. I pretty much cut and pasted I am doing this on a production server which I had no choice to do because of the auto increment bug in mysql 5.1 it made our crm software not able to add new anything. Any help on how to get this up would be great.

  • http://www.ovaistariq.net/ Ovais Tariq

    Have you uninstalled version 5.1 of mysql completely,. the error you have pasted points out to the fact that mysql is looking for the directory “/var/lib/mysql/”, instead of “/usr/local/mysql” which is where you should have installed mysql 5.5, if you followed this article,.

  • http://www.ovaistariq.net/ Ovais Tariq

    IA-64 stands for itanium which is a family of 64-bit microprocessors developed by intel,. while on the other hand x86 is a general purpose architeture used by both AMD and Intel,.

    so x86 is the one you should select,.

  • James

    Yes I did remove mysql-server-5.1 and mysql-server. Do I have to remove mysql-common as well which I had installed? I removed everything last night and am starting from a clean slate today. Thank you for the reply.

  • http://www.ovaistariq.net/ Ovais Tariq

    Yup everything,. if you can then restart my tutorial and follow every step,.

    even then if you face any issues., you can let me know and may be i can have a look at it using a terminal, remotely., completely ur call,.

  • James

    Very nice tutorial. I was able to install mysql 5.5 successfully and start and stop the server with no errors. My question is in the tutorial the directions say to do:

    $ mkdir /root/mysql-5.1-conf
    $ cp -R /etc/mysql/ /root/mysql-5.1-conf

    $ mkdir /root/mysql-5.1-data
    $ cp -R /var/lib/mysql/ /root/mysql-5.1-data

    $ mkdir /root/mysql-5.1-dump
    $ mysqldump -u user_name -p –databases mysql > /root/mysql-5.1-dump/mysql.sql
    $ mysqldump -u user_name -p –databases webapp > /root/mysql-5.1-dump/webapp.sql

    Am I suppost to copy /root/mysql-5.1-conf back into /etc/mysql/ & /root/mysql-5.1-data back into /var/lib/mysql/?

    Also with this part:

    $ cd /root/mysql-5.1-backup/dump/
    $ mysql < mysql.sql

    I have a few databases that I dumped. Should I use this same syntax to add them into 5.5 before I do the:
    $ mysql_upgrade

    The only problem now that I am having is when I try to access my web apps most of them give me a blank page. One of them which is vtiger gives me this error:

    Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /var/www/includes/database/mysql/database.inc on line 43

    I have the dumps for each of my web apps so I should be able to import them back into 5.5 correct?

  • James

    Ok I am sorry for posting so much I wanted to leave one more peice of information before I am off of work. As I said I got mysql 5.5 installed and running. I can connect to the database as root or any the other 2 users that I have set up. Still I am having my problem with blank pages. I have all my data backed up as a dump then I also exported all of the data in csv files for a redundant back up. So I figured I would install my web app from scratch but when I get to the check page it says this:

    MySQL – back-end database NolaPro utilizes

    MySQL must be installed and be precompiled or loaded as an extension with PHP.

    So I tried apt-get install php5-mysql. This did not help me I am still not able to install the app again thinking I need to configure php5-mysql with the sql installation. I am also still getting blank pages from the already existing installs. I am sure the databases are intact I just dont know what is causing the blank pages. My alternative is to install from scratch and import my data, but I am getting the error above: MySQL must be installed and be precompiled or loaded as an extension with PHP. So if you could point me in the right direction as to what file I need to configure I could get the rest of the info on the net. Thanks again for your tutorial.

  • http://www.ovaistariq.net/ Ovais Tariq

    Hello James,.

    About this,

    ——————————————————————————————————–

    $ mkdir /root/mysql-5.1-conf
    $ cp -R /etc/mysql/ /root/mysql-5.1-conf

    $ mkdir /root/mysql-5.1-data
    $ cp -R /var/lib/mysql/ /root/mysql-5.1-data

    Am I suppost to copy /root/mysql-5.1-conf back into /etc/mysql/ & /root/mysql-5.1-data back into /var/lib/mysql/?

    ———————————————————————————————————

    Well I have these steps in the tutorial so, that we have everything backed up, just in case anything goes wrong with the installation of 5.5 and you have to go back to the previous version., These are precautionary steps,.

    And about this,

    ———————————————————————————————————

    $ mkdir /root/mysql-5.1-dump
    $ mysqldump -u user_name -p –databases mysql > /root/mysql-5.1-dump/mysql.sql
    $ mysqldump -u user_name -p –databases webapp > /root/mysql-5.1-dump/webapp.sql
    ——————————————————————————————————–

    In this step I have dumped mysql data, so that it can be reimported in the database, after we have installed mysql 5.5

  • http://www.ovaistariq.net/ Ovais Tariq

    About this question,

    ————————————————————————————————————
    $ cd /root/mysql-5.1-backup/dump/
    $ mysql < mysql.sql

    I have a few databases that I dumped. Should I use this same syntax to add them into 5.5 before I do the:
    $ mysql_upgrade
    ———————————————————————————————————-

    Except for "mysql" database, all the remaining databases can be imported after running mysql_upgrade.

    Its only with the "mysql" database, that you have to first import the "mysql" database and then run "mysql_upgrade", the purpose of "mysql_upgrade" is to make the "mysql" database compatible with the new version of MySQL Server.

    ** With "mysql" database I don't mean the MySQL server, infact I mean the database that is named "mysql".

  • http://www.ovaistariq.net/ Ovais Tariq

    About importing the databases of web apps back in the MySQL server, yes you can use mysql < mysql.sql to import them back,. but do it after you have run "mysql_upgrade"

    There is going to be a slight change in the syntax, you will have to supply the username and password too,.

    mysql -u root -p < database.sql

  • http://www.ovaistariq.net/ Ovais Tariq

    can you paste the output of phpinfo()

  • Kilbane

    Hi, this guide does not works on debian based distro. It may be fine to add this mention at the start.

    Problems founds are “path” command and init.d script.

  • http://www.ovaistariq.net/ Ovais Tariq

    I don’t think there should be much of a problem doing the same install on debian,,.

    As for the “path” thing, just append the path to the bin directory in the file “/etc/profile”,.

    As for any other issue could u paste the errors here,.

  • Peter Lindqvist

    I’m getting an error when trying: mysqld –skip-grant-tables –user=mysql

    -bash: mysqld: command not found

  • http://www.ovaistariq.net/ Ovais Tariq

    Have you added the path to the MySQL bin directory, to the PATH variable., as defined in this tutorial,.

    $ vim /etc/environment
    PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/mysql/bin”

  • Anon

    This is fine for small databases, but I currently have a 150GB database I need to update to 5.5 (going 64 bit at the same time, long time coming).

    We have done the import/upgrade of the mysql table to 5.5 ok, but importing the database is taking a very long time, its only about 10% through and it’s been 24 hours. We simply cannot afford the downtime on a production system.

    Are the 5.1 table files compatible with 5.5 for a “data” database? These are myisam tables.

  • http://www.ovaistariq.net/ Ovais Tariq

    Yeah the 5.1 table files are compatible with 5.5, so you can copy them over to the data dir safely,.

  • http://twitter.com/panggi Panggi Libersa .J.A

    ” Make sure you don’t delete files belonging to the new version we are installing.

    $ rm -R /var/lib/mysql
    $ rm -R /etc/mysql
    $ rm -R /usr/lib/mysql ”

    which are the new version’s ?? because there are so many files inside those folders.. and i’m sure that you didn’t use “rm -Rf” command to delete those folders..

  • http://www.ovaistariq.net/ Ovais Tariq

    If you are installing mysql 5.5 according to this article, then the new version will be installed in the “/usr/local/mysql/” folder

  • http://twitter.com/panggi Panggi Libersa .J.A

    i have this error : “mysqld: Can’t read dir of ‘/etc/mysql/conf.d’ (Errcode: 2)” after executing :
    “mysqld –skip-grant-tables –user=mysql” .. why it still call the /etc/mysql/ ??

    Thanks :)

  • http://twitter.com/panggi Panggi Libersa .J.A

    i also have this error “/usr/local/mysql/bin/my_print_defaults: Can’t read dir of ‘/etc/mysql/conf.d’ (Errcode: 2)” when i wanna start mysql at /etc/init.d/

  • http://www.ovaistariq.net/ Ovais Tariq

    Did you follow all the steps in this post., Looks like there is some problem with the config file,.,

    Did you follow this step “Copy the sample MySQL configuration file to the etc directory and setup the paths”

  • http://profiles.google.com/jonathonbyrd Jonathon Byrd

    Definitely not trying to snake any glory here, but from the start I had problems because that download location is no longer active. I have rewritten this tutorial with my new experiences. http://www.5twentystudios.com/blog/2011/04/21/installing-mysql-5-5-11/

  • http://www.ovaistariq.net/ Ovais Tariq

    Thanks for pointing the erroneous URL, I have updated the URL to the one that is working,. let me know if you faced any other issues,.

  • Mal

    Hi Guys,

    Have a problem with starting mysql. See errors

    Starting MySQL
    .. * The server quit without updating PID file (/usr/local/mysql/data/jack.pid).
    root@jack:/usr/local/mysql/bin#

    My base and data dir as follows:
    base=/usr/local/mysql
    data=/usr/local/mysql/data

    The error log shows

    InnoDB: Apply batch completed
    110429 12:52:31 InnoDB: 1.1.4 started; log sequence number 1595675
    110429 12:52:31 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
    110429 12:52:31 mysqld_safe mysqld from pid file /usr/local/mysql/data/jack.pid ended
    110429 12:54:53 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
    110429 12:54:53 [Note] Plugin ‘FEDERATED’ is disabled.
    /usr/local/mysql/bin/mysqld: Table ‘mysql.plugin’ doesn’t exist
    110429 12:54:53 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
    InnoDB: The InnoDB memory heap is disabled
    InnoDB: Mutexes and rw_locks use GCC atomic builtins
    InnoDB: Compressed tables use zlib 1.2.3
    110429 12:54:53 InnoDB: Using Linux native AIO
    110429 12:54:53 InnoDB: Initializing buffer pool, size = 2.0G
    110429 12:54:53 InnoDB: Completed initialization of buffer pool
    110429 12:54:53 InnoDB: highest supported file format is Barracuda.
    InnoDB: Log scan progressed past the checkpoint lsn 48941
    110429 12:54:53 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files…
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer…
    InnoDB: Doing recovery: scanned up to log sequence number 1595675
    110429 12:54:53 InnoDB: Starting an apply batch of log records to the database…
    InnoDB: Progress in percents: 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
    InnoDB: Apply batch completed
    110429 12:54:54 InnoDB: 1.1.4 started; log sequence number 1595675
    110429 12:54:54 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist
    110429 12:54:54 mysqld_safe mysqld from pid file /usr/local/mysql/data/jack.pid ended

    I’ve also deleted the my.cnf and create a new one but get the same error

    Any suggestions please on where I could have gone wrong ?

    Thanks
    Mal

  • http://www.ovaistariq.net/ Ovais Tariq

    Looks like you haven’t run mysql_upgrade,,. I suggest you redo all the steps starting from “Start MySQL server without grants table.” section in this tutorial,. and let me know if you face any more issues,.

  • Bryan Lee

    Great tutorial!  I also ran into this 32 vs 64-bit issue, which was confusing because when I tried to run mysqld it just said mysqld: No such file or directory, even though the file was clearly there.

    It turned out I needed to run:
    sudo apt-get install ia32-libs

    and now things seem to work ok.

    Oh, also my my.cnf file had a [client] section.  I had put the other settings under [mysqld] section, so I needed to change socket under [client] to match the one I added under [mysqld].  And of course, change 5.8 to 5.11 everywhere (or whatever the version is you’re using).

    Thanks!

  • Jake

    Hi Ovais,

    I try to follow all the steps but when i try to run my sql i got an error.

    mysqld –skip-grant-tables –user=mysql
    110614  9:32:56 [Warning] Can’t create test file /var/lib/mysql/CK011.lower-test
    110614  9:32:56 [Warning] Can’t create test file /var/lib/mysql/CK011.lower-test
    mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 2)
    110614  9:32:56 [ERROR] Aborting

    110614  9:32:56 [Note] mysqld: Shutdown complete

    Can you help me to check it.

    thanks,
    Jake

  • Jake

    hi still have some error:
    mysqld –skip-grant-tables –user=mysql
    -bash: /usr/sbin/mysqld: No such file or directory

    can anyone help me on upgrading mysql 5.5.

    thanks,
    Jake

  • Steve Voida

    Super-helpful tutorial and worked great for me on OSX. Thanks!

  • http://pulse.yahoo.com/_4NM4RSDCI6Q5BKHPQZNOYL2MC4 SherOcs

    After running this command: mysqld –skip-grant-tables –user=mysql
    This is what I got.
    The program ‘mysqld’ can be found in the following packages:
     * mysql-server-core-5.1
     * mysql-cluster-server-5.1
     * mysql-server-core-5.0
    Try: apt-get install

    Please help….

  • http://www.ovaistariq.net/ Ovais Tariq

    That is probably because you did not add the path to mysql binaries to your path variable,.

  • http://www.ovaistariq.net/ Ovais Tariq

    Glad it helped,.

  • Asdf

    thanks. I have precisely followed your instructions and now i don’t have mysql at all. I’m gettint
    “Can’t create test file /var/lib/mysql/bob-desktop.lower-test”
    error like many others.

    Please stop writing guides when you don’t know what you are doing.

  • http://www.ovaistariq.net/ Ovais Tariq

    The error shows you probably didnt follow the guide correctly, and if this really was a bad guide, it wouldnt have so many success comments after all. Anyways thank you for commenting :)

  • http://antonymandilas.pip.verisignlabs.com/ Antony

    Hey all,

    I tried to install mysql 5.5 at ubuntu 10.10 following this guide. Unfortunately i am getting the following error when i try to start the server:

    /etc/init.d/mysql: 256: /usr/local/mysql/bin/my_print_defaults: not found
    Starting MySQL
    . * The server quit without updating PID file (/usr/local/mysql/data/corfu.pid).

    In the error log i am getting the following error:

    110818 23:28:27 mysqld_safe Starting mysqld daemon with databases from /usr/loca
    l/mysql/data
    nohup: failed to run command `/usr/local/mysql/bin/mysqld’: No such file or dire
    ctory
    110818 23:28:27 mysqld_safe mysqld from pid file /usr/local/mysql/data/corfu.pid
     ended

    but definitely this file exists ( /usr/local/mysql/bin/mysqld ). Any ideas?

    Thanks a lot,
    Antony

  • Anonymous

    what was your backout plan in case things went terribly wrong?

  • http://www.ovaistariq.net/ Ovais Tariq

    In case everything went wrong, we can utilize the backups if you followed this tutorial exactly.

    Remove the MySQL binary from /usr/local/ and remove the startup script from /etc/init.d/mysql

    Install the default version of mysql again:

    apt-get install mysql-server-5.1
    apt-get install mysql-client

    Recover the config as follows:
    cp -R /root/mysql-5.1-conf /etc/mysql/
    Recover the data as follows:cp -R /root/mysql-5.1-data /var/lib/mysql/
    Let me know what else you need from me, may be I can have a look at your machine to recover for you :)

  • tirengarfio

    Thanks for you tutorial,

    I’ve followed the instructions, but after “mysqld –skip-grant-tables –user=mysql”, I’m getting this:

    sudo mysqld –skip-grant-tables –user=mysql
    110913 20:29:18 [Warning] Can’t create test file /var/lib/mysql/my-laptop.lower-test
    110913 20:29:18 [Warning] Can’t create test file /var/lib/mysql/my-laptop.lower-test
    mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 2)
    110913 20:29:18 [ERROR] Aborting
    110913 20:29:18 [Note] mysqld: Shutdown complete

    what I think it could be normal because you ask us to do “rm -R /var/lib/mysql” on the step before. So I then create /var/lib/mysql, execute again “mysqld –skip……” and I get this:

    110913 20:32:07 [Note] Plugin ‘FEDERATED’ is disabled.
    110913 20:32:07  InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: ‘create’.
    InnoDB: Cannot continue operation.

    This is my /etc/my.cnf:

     # The following options will be passed to all MySQL clients
    [client]
    user            = mysql
    #password    = your_password
    port        = 3306
    socket        = /var/run/mysqld/mysqld.sock

    # Here follows entries for some specific programs

    # The MySQL server
    [mysqld]
    socket        = /var/run/mysqld/mysqld.sock
    port        = 3306
    basedir         = /usr/local/mysql
    datadir         = /usr/local/mysql/data
    tmpdir          = /tmp
    log_error       = /var/log/mysql/error.log 
    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 1M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    # Try number of CPU’s*2 for thread_concurrency
    thread_concurrency = 8

     I have ubuntu 10.10.

    Any idea?

    Javi

  • http://www.adminscode.com/trying-to-update-to-5-5-no-replies.html Trying to update to 5.5 (no replies) | Coders & Admins
  • Nikunj

    Followed your tutorial. Now stuck at like many others.

    nikunj@IBMX3650M3:~$ mysqld –skip-grant-tables –user=mysql
    110915 11:54:52 [Warning] Can’t create test file /var/lib/mysql/IBMX3650M3.lower-test
    110915 11:54:52 [Warning] Can’t create test file /var/lib/mysql/IBMX3650M3.lower-test
    mysqld: Can’t change dir to ‘/var/lib/mysql/’ (Errcode: 2)
    110915 11:54:52 [ERROR] Aborting

    110915 11:54:52 [Note] mysqld: Shutdown complete

    Request your guidance to resolve the issue.

  • http://www.ovaistariq.net/ Ovais Tariq

    Have you uninstalled version 5.1 of mysql completely,. the error you
    have pasted points out to the fact that mysql is looking for the
    directory “/var/lib/mysql/”, instead of “/usr/local/mysql” which is
    where you should have installed mysql 5.5, if you followed this
    article,.

  • Anonymous

    For ubuntu 11.04 natty and 11.10 oneiric 
    install a small howto from ppa and apt-get install from shell

    Step1:
    sudo joe /etc/apt/sources.list *your editor like vim,joe…*

    Step 2:
    Enter this lines in your sources.list

    For natty this:

    deb http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty main
    deb-src http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu natty mainFor oneiric this:deb http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu oneiric main
    deb-src http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu oneiric mainSave the sources list in vim :wqStep 3:Add this key 
    sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 29A4B41A

    Step 4:

    apt-get update
    apt-get install mysql-server

    Thats it

    mysql -v

  • Anonymous

    for maverick it works

  • Uvdevnull

    It’s probably not a “must”, but official mysql documentation recommends the following:

    “As a general rule, to upgrade from one release series to another, you should go to the next series rather than skipping a series. To upgrade from a release series previous to MySQL 5.1, upgrade to each successive release series in turn until you have reached MySQL 5.1, and then proceed with the upgrade to MySQL 5.5. For example, if you currently are running MySQL 5.0 and wish to upgrade to a newer series, upgrade to MySQL 5.1 first before upgrading to 5.5, and so forth.”

  • uvdevnull

    @ovais.tariq
    Great writeup man, thanks a million!

  • http://blog.shanbay.com/archives/937 扇贝网(一起背单词) » Ubuntu 11.04将MySQL5.1升级到5.5

    [...] A step by step guide to upgrading to MySQL 5.5 [...]

  • http://blog.infogroom.fr/2011/10/03/recherche-fulltext-sur-une-base-innodb-avec-doctrine-symfony-2/ Recherche Fulltext sur une base innoDB avec Doctrine / Symfony 2 | Jérémy Hubert

    [...] installé tout ça sur Ubuntu grâce à ce tuto qui marche pareil pour mysql 5.6 [...]

  • Chris

    Same problem here. I think the problem is that on Ubuntu you cannot completely remove the old php Client because of dependency, so even if you have installed the new mysql client, PHP on ubuntu keep using the old one. I guess there must be an option somewhere to change it.

  • SHHlearner

    So I’m stuck when starting the server:

    111021 14:52:26 [ERROR] Can’t find messagefile ‘/usr/local/mysql/mysql-5.5.11-linux2.6-x86_64/share/mysql/english/errmsg.sys’
    111021 14:52:26 [Warning] Can’t create test file /usr/local/mysql/mysql-5.5.11-linux2.6-x86_64/data/K.lower-test
    111021 14:52:26 [Warning] Can’t create test file /usr/local/mysql/mysql-5.5.11-linux2.6-x86_64/data/K.lower-test

    So for the first error the file is present at the named location and readable
    -rwxr-xr-x  1 7161 uucp  42K 2011-03-31 16:38 errmsg.sys

    Any ideas. 

    Thank you in advance

  • Tirengarfio

    Hi,

    after finishing all the steps I do “$ mysql -u root -pXXXX” and it says:

    Error 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: YES).

    The tutorial worked for me sometime ago, but now I have this problem. I
    have reinstalled ubuntu+mysql 5.1 and I have no problem doing “mysql -u
    root -pXXXX”, but after upgrading to 5.5 I get again the error above..

    Any idea?

    Regards

    Javi

  • Tirengarfio

    It’s me again. This is my my.cnf file:

    # The following options will
    be passed to all MySQL clients[client]#password    =
    your_passwordport        = 3306socket        =
    /var/run/mysqld/mysqld.sock# Here follows entries for some
    specific programs
    # The MySQL server[mysqld]user            = mysqlsocket   
        = /var/run/mysqld/mysqld.sockport        = 3306basedir        
    = /usr/local/mysqldatadir         = /usr/local/mysql/datatmpdir         
    = /tmp
    log_error       = /var/log/mysql/error.logskip-external-locking

     
    Javier

  • Tirengarfio

    It’s me again:

    I have installed mysql 5.5 on ubuntu 11.10 64 bits.

    Javier

  • http://twitter.com/SebastianKnopp Sebastian Knopp【ツ】

    hey,

    thanks for that article. i followed your instructions and it worked like a charm!

  • Anonymous

    Get an Error after :
    mysqld --skip-grant-tables --user=mysql


    [Warning] Can't create test file /usr/local/mysql/data/ubuntu-virtual.lower-test
    [Warning] Can't create test file /usr/local/mysql/data/ubuntu-virtual.lower-test

    Waht’s wrong? I already checked the permission for /usr/local/mysql and re-done the “correct permissions” step…

  • Anonymous

    ..and another question: In which section of /etc/my.cfg should I copy the “configurations”? in [client] or in [server] ?

  • http://www.ovaistariq.net/ Ovais Tariq

    You should copy the configurations in the “[mysqld]” section. The “[client]” sections holds parameter values that the mysql client uses when connecting to the mysql server.

  • http://dark-star1.myopenid.com/ Inprimus

    I added the path and got the above error also. So I decided to go into the bin directory for the new install and run it from there. Now I get the following:
    111220 21:54:23 [ERROR] Can’t start server : Bind on unix socket: Permission denied
    111220 21:54:23 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
    111220 21:54:23 [ERROR] Aborting

    111220 21:54:23  InnoDB: Starting shutdown…
    111220 21:54:24  InnoDB: Shutdown completed; log sequence number 1595675
    111220 21:54:24 [Note] ./mysqld: Shutdown complete

    i am installing on a brand new system with no mySQL server 11.10 trying to install the latest

  • http://dark-star1.myopenid.com/ Inprimus

    I can confirm this is the only solution (meveos’) that works for 11.10 I will try for 10.10 later. Yes Tariq I followed your guide twice to the letter. and I was hitting errorrs like so many others. So thanks meveo

  • http://www.ovaistariq.net/ Ovais Tariq

    From your config file the MySQL data directory should be /usr/local/mysql/data, but MySQL is trying to work in the directory /var/mysql/lib which means that either you have config files still remaining in /etc/mysql/ directory or you have another MySQL package installed.

    Can you provide me with the output of the following:

    ls -l /etc/ | grep mysql

    and the output of the following:

    dpkg –get-selections | grep mysql

  • http://www.ovaistariq.net/ Ovais Tariq

    Could you follow the steps from the sections “Start MySQL server without grants table” to onwards.

  • http://www.ovaistariq.net/ Ovais Tariq

    Could you send me the output of the following command:

    ls -l /usr/local/mysql/ | grep data

    and the contents of the /etc/my.cnf file

  • http://skyweb.ro/2011/02/11/upgrading-to-mysql-5-5/ A Techies' Blog » Blog Archive » Upgrading to MySQL 5.5
  • http://www.techpot.net/?p=18126 T客网 ︱ Techpot » Blog Archive » 手把手教你升级到 Mysql 5.5

    [...] 本文基本上是这篇(http://www.ovaistariq.net/490/a-step-by-step-guide-to-upgrading-to-mysql-5-5/)的翻译。 [...]

  • http://talkingit.wordpress.com/2012/01/31/create-multiple-wordpress-blogs-on-localhost/ Create multiple WordPress blogs on localhost « Talking IT

    [...] A step by step guide to upgrading to MySQL 5.5 [...]

  • http://www.storageonline.com.cn/life_work/diary/how-to-upgrade-mysql-from-5-0-to-5-5/ 存储人生 » Blog Archive » Windows下升级MySQL5.0到5.5

    [...] A step by step guide to upgrading to MySQL 5.5 [...]

  • Andre Cornelissen

    things that did not work for me:
    /usr/sbin/mysqld  (the 5.1 daemon) was still there and earlier inthe PATH
    now starting 5.5 daemon but unable to create socket, probably fighting apparmor as I see a /etc/apparmor.d/usr.sbin.msqld (probablu left over) but no usr.local.mysql.bin.mysqld config.

    Boeboe

  • Gare

    Thank you for writing this tutorial.  It is very helpful.  I have an ubuntu-related question:  

    Were you able to install other mysql related components via apt-get in ubuntu repo’s, like php5-mysql ?

    php5-mysql  depends on libmysqlclient16 and mysql-common.    Can we install these from apt as well?

    Thank you again.

  • NicoVS

    Just a few problems i encountered:
    I downloaded  MySQL Community Server 5.5.25When trying to start mysql with mysqld –skip-grant-tables –user=mysql i got this error:1)  [ERROR] Error message file ‘/usr/local/mysql-5.5/share/english/errmsg.sys’ had only 641 error messages, but it should contain at least 728 error messages.=> fixed by: # cd /root/mysql-5.5-install# ar vx mysql-5.5.25-debian6.0-x86_64.deb# tar -xvf data.tar.gz# cp opt/mysql/server-5.5/share/english/errmsg.sys /usr/loca/mysql/share/errmsg.sys2) Then i could start mysql with mysqld –skip-grant-tables –user=mysql but i could not mysql < mysql.sql.I modified /etc/my.cnf the wrong way… i needed to change my /etc/my.cnf like this:# The following options will be passed to all MySQL clients[client]#password       = your_passwordport            = 3306socket          = /var/run/mysqld/mysqld.sock# Here follows entries for some specific programs# The MySQL server[mysqld]port            = 3306user            = mysqlpid-file        = /var/run/mysqld/mysqld.pidsocket          = /var/run/mysqld/mysqld.sockbasedir         = /usr/local/mysqldatadir         = /usr/local/mysql/datatmpdir          = /tmplog_error       = /var/log/mysql/error.logThats it :)

  • http://www.facebook.com/interian87 Jose Interian

    Hello, thxs for your step by step guide. So can you help me with apache 2.4.2 and php 5.4.4 STEP BY STEP? i’m using LAMP Native from UBUNTU SERVER 10.4. i really need a lot of help

  • Gare

    Hi - 

    Consider upgrading Ubuntu to 12.04 , and it will upgrade Apache and PHP and MySQL for you.  currently 12.04 includes MySQL version 5.5.24.  

  • Ray Ban Sunglasses

    Ray Ban
    UK
    have produced its initial appearance about 80years
    in the past and become a hitting item inside the market speedily. These
    Ray Ban
    Sunglasses
    are committed to blocking glares and
    several other dangerous rays. Due to their distinctive traits and effectiveness
    in filtering dangerous rays, raybanuk2012.net
    grows to be widely accepted and famous all over the globe.

     

  • Kushal

    I have just began learning. I have installed MySQL 5.5 working on local host. Can any one suggest me how to connect my own database over the internet

  • Kushal

    Can any one suggest to my question above

  • http://www.ovaistariq.net/ Ovais Tariq

    To connect to MySQL over the internet, you need to make sure the following things work:
    - The port 3306 is opened up in the firewall and remote machines can connect to the MySQL host
    - MySQL is listening on the public IP interface
    - The MySQL host is connected to the internet
    - A MySQL user exists that allows ppl to login to the MySQL server

  • ara

    I’ve crash my server Step by Step. !!!

  • thujee

    Same problem here, the environment variable are added correctly.
    but it throws `The program ‘mysqld’ can be found in the following packages`

  • http://www.linuxquestions.org/questions/linux-newbie-8/trying-to-upgrade-mysql-from-5-1-to-5-5-on-debian-4175435309/#post4820871 trying to upgrade mysql from 5.1 to 5.5 on debian

    [...] Here is a tutorial that might help: A step by step guide to upgrading to MySQL 5.5 [...]

  • Anonymous

    What happens with `service mysql (start|stop|status)`? They seem to be missing after following this procedure

  • Anonymous

    You forgot to mention this in the post. :)

  • http://www.dbforums.com/mysql/1687526-how-upgrade-mysql-5-0-5-5-redhat-linux.html#post6575202 how to upgrade mysql 5.0 to 5.5 in redhat linux – dBforums

    [...] A step by step guide to upgrading to MySQL 5.5 | ovais.tariq __________________ I'd rather be riding my Versys or my Tiger 800 let alone the Norton [...]

  • Roman

    Perfectly wroted and everything is working.
    PS: If you are amateur in linux so mysql_upgrade script and mysqld is in /var/lib/mysql/bin directory.

  • Roman

    Sorry. /usr/local/mysql/bin .

  • mysql world

    exit terminal and login again or run below command

    source /etc/environment

  • Trotamundos

    Hi!

    I have gone through all steps except the creation of the socket directory because it already existed.

    Then, on the step when I had to run: mysql < mysql.sql I got the following error:

    "ERROR 1006 (HY000) at line 22: Can't create database 'mysql' (errno: 2)"

    Could you please help me?

    Thanks!

  • http://www.ovaistariq.net/ Ovais Tariq

    Can you check the permissions of the MySQL data directory are correct?

  • Grrr Grrrr Grrrrrr

    Thank you very much for the post. I have done it successfully in Centos, though some commands differ the overall procedure are very same :)

  • http://redrokk.com/2011/04/21/installing-mysql-5-5-11/ MySQL 5.5.11 Installation Tutorial – Step One | REDROKK – Interactive Marketing REDROKK – Interactive Marketing

    [...] to get MySQL upgraded from 5.1 to 5.5. Since this was the best tutorial that I was able to find (http://www.ovaistariq.net/490/a-step-by-step-guide-to-upgrading-to-mysql-5-5/), I’ll give Ovais Tariq a plug here. Although the Ovais Tariq tutorial was very informative [...]

  • http://tiberiucontiu.ro/mysql-in-paralel-cu-percona/ Mysql în paralel cu Percona | Tiberiu Contiu
  • http://www.facebook.com/ihor.mysak.1 Ihor Mysak

    you can write “–all-databases” for mysqldump instead of dump each DBs

    and Thanks :)

  • http://www.eonlinegratis.com/2013/install-mysql-5-5-on-ubuntu-10-04/ Install MySQL 5.5 On Ubuntu 10.04 | Click & Find Answer !

    [...] the binary installation instructionsI used The following guide to install 5.5 on Ubuntu 10.04: http://www.ovaistariq.net/490/a-step-by-step-guide-to-upgrading-to-mysql-5-5/Everything worked perfectly except one of the final steps, launching mysql:mysqld [...]

  • Michael

    Hi,

    thanks for the detailed guideline.

    It worked fine till I faced the point starting the server without grant-tables.

    $ mysqld –skip-grant-tables –user=mysql
    -bash: /usr/local/mysql/bin/mysqld: No such file or directory

    But $ ls /usr/local/mysql/bin/
    shows the mysqld and others.

    Does anyone know how to overcome that problem?

    Thanks for your help in advance.

  • James Lari

    ERROR 404: Not Found.

    How can I download the latest version of Mysql for my ubuntu 10.04 server ?

  • http://www.ovaistariq.net/ Ovais Tariq
  • Ravi Soni
  • http://www.ovaistariq.net/ Ovais Tariq

    The download link changes as new releases of MySQL 5.5 are made. You can find the latest 5.5 release here:

    - For 32-bit platforms: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.32-linux2.6-i686.tar.gz/from/http://cdn.mysql.com/

    - For 64-bit platforms: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.32-linux2.6-x86_64.tar.gz/from/http://cdn.mysql.com/

  • Rohan

    Thanks Ovais! Could you please suggest the steps for RedHat ( RPM Style) same upgradation.

  • http://www.jugarjugar.net/ Jugar Jugar

    Thank you for sharing your this useful. I’m still not ready to update to this new version even though it has many significant improvements. I’m really looking forward to more in it. and I still like the older version, it really suit me

  • http://maulikblog.wordpress.com/2014/02/17/bookmark-17-feb-52-_office_pc/ Bookmark 17 feb 14__PC | maulikblog

    [...] >2.3.7. Upgrading MySQL Server on Microsoft Windows.url</A> <DT><A HREF=”http://www.ovaistariq.net/490/a-step-by-step-guide-to-upgrading-to-mysql-5-5/&#8221; ADD_DATE=”1341490914″ LAST_VISIT=”1341490914″ [...]

  • http://superhero.com Frederik87k

    Hei, just trying to follow this procedure. But this is strange: Step 12: Copy the sample MySQL configuration file. Then step 14: Remove the MySQL files from the older version. So I copy the config and delete it again!? oO ^^

  • amicns

    Please don’t follow this article. It doesn’t work rather screw up your system.

  • http://www.ovaistariq.net/ Ovais Tariq

    There are hundreds of people who have successfully upgraded to MySQL 5.5 using this article as a reference, since it was written more than 3 years ago. If you have done something wrong and not followed the steps correctly, then it comes down to you and not the article.

blog comments powered by Disqus