Today, I did a bit of it, under the Linux system CentOs6.5 use source mode to install and configure MySQL, here to record the steps.
A) Download the Mysql,source version. Mysql-5.6.20.tar.gz
b) Install the tools and libraries required to compile the source code
Yum Install GCC GCC Perl
c) Install CMake
wget http://tar -xzvf cmake-2.8. 10.2. Tar . GZCD CMake-2.8. 10.2 . Make Make Install
d) New MySQL user group
Groupadd MySQL
e) New MySQL user
Useradd-r-G MySQL MySQL
f) Create a new MySQL installation directory
mkdir -p/usr/local/mysql
g) New MySQL database data file directory
mkdir -p/data/mysqldb
h) MySQL source package and unzip and install
tar -zxv-f mysql-5.6. . Tar . gzcd MySQL-5.6. -
i) compile and install MySQL
1 cmake \2-dcmake_install_prefix=/usr/local/mysql \3-dmysql_unix_addr=/usr/local/mysql/mysql.sock \4-ddefault_charset=UTF8 \5-ddefault_collation=utf8_general_ci \6-dwith_innobase_storage_engine=1 \ 7-dwith_archive_storage_engine=1 \ 8-dwith_blackhole_storage_engine=1 \ 9-dmysql_datadir=/data/mysqldb \Ten-dmysql_tcp_port=3306 \ One-denable_downloads=1
j) Rerun configuration, need to delete CMakeCache.txt file
RM CMakeCache.txt
k) Compile the source code, install
Make make Instsall
L) Modify the MySQL directory owner and group, permissions
cd/usr/local/mysqlchown -/data/mysqldbchown -R mysql:mysql.
m) Initialize MySQL database
cd/usr/local/mysqlscripts
n) Copy the MySQL service startup configuration file
CP /USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
(MY.CNF on/etc is detected at startup)
O) Add the startup script to the path path
CP support-files/mysql.server/etc/init.d//etc/profile PATH=/usr/local/mysql/bin :/usr/local/mysql/lib: $PATH /etc/profile
p) Start MySQL
Error:
file could not being found! [failed] file (/usr/local/mysql/data/rekfan.pid). Failed
Look at the log is not specified in the configuration file data directory, add DataDir =/usr/local/mysql/data in/etc/my.cnf
After restart, this error is reported, after troubleshooting may be the/usr/local/mysql/data/rekfan.pid file does not have permission to write.
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data &
problem solving.
Q) Login MySQL (initial no password)
R) Modify the password for the Myhsql user root
Mysqladmin-u Root Password XXXXXX
Installation log for MySQL under CentOS Linux system