mysql5.6版本安装

yum -y install cmake make gcc-c++ ncurses-devel perl


groupadd mysql

useradd -r -g mysql mysql


cmake .      ##cmake . -LH 或者 ccmake .##

        -DCMAKE_INSTALL_PREFIX=/usr/local/mysql 

        -DENABLE_DOWNLOADS=1

        -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

make

make install


cd /usr/local/mysql

chown -R mysql .

chgrp -R mysql .

scripts/mysql_install_db --user=mysql   ##mysql_install_db生成了一个默认的配置文件my.cnf,这个文件是由源码包里的模板my-default.cnf文件建立的

scripts/mysql_install_db --user=mysql --defaults-file=/usr/local/mysql/my.cnf

 

chown -R root .

chown -R mysql data

bin/mysqld_safe --user=mysql &



cp support-files/mysql.server /etc/init.d/mysql.server

export PATH=$PATH:/usr/local/mysql/bin  ## /etc/profile ##

source /etc/profile



你可能感兴趣的:(mysql)