Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Install MySQL 5.5 From Source (Load Data Local Infile Issues?)  (Read 977 times)

0 Members and 1 Guest are viewing this topic.

Amal John Ronkha

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
How to do it?

If you already have an installation your data directory and configuration file (my.cnf) should remain untouched. But you may have to look into the source configuration options to connect to your current setup (specifically -DMYSQL_DATADIR for your data directory and -DSYSCONFDIR for your my.cnf)

If this is a new installation you still have a few steps after those below, they are included in the MySQL Post installation Procedures.
The Process

I’ll be truthful, I did quite a bit of research and didn’t find a definitive guide on how to install MySQL from source, but I aim to provide a guide that gets as close as possible as quick as possible!

Right, let's get on with it.

    Firstly, remove any current installations of MySQL server. Open up a terminal and type/copy the following in…

Code: [Select]
sudo apt-get --purge remove mysql-server*
Code: [Select]
sudo apt-get --purge remove mysql-server*
Now, go ahead and obtain the source files and other packages required to compile and install the source. Type/copy the following into a terminal and press enter…

Code: [Select]
sudo apt-get install mysql-source-5.5 build-essential libncurses5-dev cmake   
Go to the directory where the source is…

Code: [Select]
cd /usr/src/mysql       
Un-tar (expand) the source files…

Code: [Select]
sudo tar zxvf mysql-source-5.5.tar.gz
Make a directory to store the build files (I personally like to keep them separate, not essential though)…

Code: [Select]
sudo mkdir build
And change to that directory…

Code: [Select]
cd /usr/src/mysql/build

Now we need to make the build/installation files using cmake. There are a number of options that you may wish to configure here, these source configuration options can be seen here. You may not need to add any options, you may need to add a load, the only one I needed was -DENABLED_LOCAL_INFILE. Make the build files…


       
Code: [Select]
sudo cmake ../mysql-5.5/ -DENABLED_LOCAL_INFILE=1
Now install the build we just made…

Code: [Select]
sudo make install
Copy the service file to correct location…
       
Code: [Select]
sudo cp support-files/mysql.server /etc/init.d/mysql
Start the MySQL Server…

Code: [Select]
sudo service mysql start
MySQL 5.5 should now be installed with LOAD DATA LOCAL INFILE enabled.

Hope this helps!  :)