Why?…. LOAD DATA LOCAL INFILE?
I recently updated my home machine to Ubuntu 12.04 and found MySQL 5.5 installed as default. As happy as I was to have the latest stable MySQL server, I was a bit gutted to find that LOAD DATA LOCAL was disabled as default, due to security issues. These issues may be valid but this is my local environment and I’ve got projects that require it so thought I’d waste utilize some free time fixing it.
WARNING
These are pretty simple steps in themselves but it may not necessarily end here.
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, lets get on with it shall we….
- Firstly, remove any current installations of MySQL server. Open up a terminal and type/copy the following in…
1sudo apt–get —purge remove mysql–server* - Now, we can 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…
1sudo apt–get install mysql–source–5.5 build–essential libncurses5–dev cmake - Go to the directory where the source is…
1cd /usr/src/mysql - Un-tar (expand) the source files…
1sudo 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)…
1sudo mkdir build
And change to that directory…
1cd /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…
1sudo cmake ../mysql–5.5/ –DENABLED_LOCAL_INFILE=1 - Now install the build we just made…
1sudo make install - Copy service file to correct location…
1sudo cp support–files/mysql.server /etc/init.d/mysql - Start the MySQL Server…
1sudo service mysql start
MySQL 5.5 should now be installed with LOAD DATA LOCAL INFILE enabled.
As usual, any questions please comment with your errors and we’ll see what we can do. Good luck!
Pingback: MYSQL. 5.5 > . Installation from source Ubuntu | BlogoSfera()