1.yum install cmake gcc make ncurses-devel gcc-c++
2.创建组和用户
groupadd -g 27 mysql
useradd -g 27 -u 27 -s /sbin/nologin -M mysql
指定mysql的sock文件登录mysql数据库---mysql -S /var/run/mysql/mysql.5.6.11.sock
mysql下载:
源码安装过程:
tar xf mysql-5.6.20.tar.gz
cd mysql-5.6.20
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
-DMYSQL_DATADIR:PATH=/usr/local/mysql/data \
-DWITH_DEBUG:BOOL=on \
-DWITH_EXTRA_CHARSETS:STRING=all \ 安装所有的字符
-DWITH_INNOBASE_STORAGE_ENGINE:BOOL=on \ 支持innodb引擎
-DWITH_PARTITION_STORAGE_ENGINE:BOOL=on 安装支持数据库分区
#make
#make install
#mkdir /usr/local/mysql/etc
-
#cat /usr/local/mysql5.6/etc/my.cnf
-
[mysqld]
-
basedir=/usr/local/mysql
-
datadir=/usr/local/mysql/data
-
socket=/var/run/mysqld/mysqld.sock
-
pid-file=/var/run/mysqld/mysqld.pid
-
user=mysql
-
#default-charater-set=utf8
-
character-set-server=utf8
-
[mysqld_safe]
-
log-error=/var/log/mysqld/mysqld-error.log
-
-
-
[mysql]
-
socket=/var/run/mysqld/mysqld.sock
-
-
-
[client]
-
default-character-set=utf8
-
[ -d /var/run/mysqld ] && rm -rf /var/run/mysqld/mysql* || mkdir /var/run/mysqld
[ -d /var/log/mysqld ] && rm -rf /var/log/mysqld/mysql* || mkdir /var/log/mysqld
chown -R mysql.mysql /usr/local/mysql /var/run/mysqld /var/log/mysqld
/usr/local/mysql5.6/scripts/mysql_install_db --basedir=/usr/local/mysql--datadir=/database --user=mysql 初始化数据库
cp /usr/local/mysql5.6/support-files/mysql.server /etc/rc.d/init.d/mysqld
sed -i "/conf=/c conf=/usr/local/mysql5.6/etc/my.cnf" /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
阅读(2007) | 评论(0) | 转发(0) |