Background:
Output from uname -a:
Linux dz1 3.2.36-1.46.amzn1.x86_64 #1 SMP Mon Jan 14 04:42:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Prerequisites:
Use "sudo yum list installed" for each of these to see if they exist, or just install using "sudo yum install" :
make.x86_64
cmake.x86_64
ncurses-devel.x86_64
libaio-devel.x86_64
gcc47-c++.x86_64
bison.x86_64
I created a mysql user and an installation directory in /opt/mysql. That is where I copied the downloaded source file mysql-5.6.10.tar.gz. Exctracting creates the new mysql-5.6.10 subdirectory:
Created a "build" subdirectory:
cd /opt/mysql/mysql-5.6.10
mkdir build.dz
cd build.dz
Ran a script with this in contents to configure. Note that TMPDIR is the only environment variable set. The flags are passed in on the command line now:
#!/bin/bash
TMPDIR=/tmp
cmake /opt/mysql/mysql-5.6.10 \
-DBUILD_CONFIG=mysql_release \
-DENABLE_DOWNLOADS=1 \
-DCMAKE_INSTALL_PREFIX=/opt/mysql/mysql-5.6.10-amazon.x86_64\
-DWITH_INNODB_MEMCACHED=ON \
"-DCMAKE_C_FLAGS= -m64" \
"-DCMAKE_CXX_FLAGS= -m64" \
-DSYSCONFDIR=/etc
That produced an error:
-- Successfully downloaded http://googlemock.googlecode.com/files/gmock-1.6.0.zip to /opt/mysql/mysql-5.6.10/source_downloads
CMake Error: Problem with tar_extract_all(): Invalid argument
CMake Error: Problem extracting tar: /opt/mysql/mysql-5.6.10/source_downloads/gmock-1.6.0.zip
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/mysql/mysql-5.6.10/build.dz
After running the "cmake" script once, I emptied the build.dz subdirectory, then did this before re-trying the cmake command:
cd /opt/mysql/mysql-5.6.10
unzip /opt/mysql/mysql-5.6.10/source_downloads/gmock-1.6.0.zip
.... re-ran the cmake command as shown above.
Running make took about 8 hours on a micro instance. :
nohup make > log.make 2>&1 &
Then run the tests:
make test
make install
I ran the extended tests too:
cd /opt/mysql/mysql-5.6.10/build.dz/mysql-test
nohup ./mysql-test-run > log.mysql-test-run 2>&1 &
which failed with this error:
Can't locate Time/HiRes.pm in @INC (@INC contains: lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at lib/mtr_report.pm line 440.
BEGIN failed--compilation aborted at lib/mtr_report.pm line 440.
Compilation failed in require at lib/mtr_cases.pm line 27.
BEGIN failed--compilation aborted at lib/mtr_cases.pm line 27.
Compilation failed in require at ./mysql-test-run line 95.
BEGIN failed--compilation aborted at ./mysql-test-run line 95.
So I installed the hi res package.
sudo yum install perl-Time-HiRes
The mysql-test-run suite failed again due to a truncation error with the mysqlhotcopy tests. I fixed this by editing /opt/mysql/mysql-5.6.10/mysql-test/include/mysqlhotcopy.inc to change the varchar(20) column datatypes to varchar(30).