码迷,mamicode.com
首页 > 数据库 > 详细

编译安装mysql5.6.40

时间:2018-06-01 16:19:48      阅读:772      评论:0      收藏:0      [点我收藏+]

标签:编译mysql

1、官网下载mysql
技术分享图片技术分享图片

2、安装依赖包

yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio
yum install libaio libaio-devel -y
yum install perl-Data-Dumper -y
yum install net-tools -y
tar -zxvf mysql-5.6.40.tar.gz
cd mysql-5.6.40
# 创建mysql用户组
groupadd mysql
useradd -g mysql mysql

3、编译安装mysql

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
make install

3.1、执行初始化配置脚本

cd /usr/local/mysql
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql

3.2、拷贝启动脚本并启动

cp support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
service mysql start

4、登陆配置密码

vi /etc/profile
#在末尾添加
PATH=/usr/local/mysql/bin:$PATH
export PATH

source /etc/profile

mysql -u root -p
SET PASSWORD = PASSWORD(‘fan‘);
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘fan‘ WITH GRANT OPTION;

至此mysql编译安装完成。

编译安装mysql5.6.40

标签:编译mysql

原文地址:http://blog.51cto.com/243662875/2123108

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!