首页 > 数据库技术 > 详细

编译安装mysql5.6

时间:2018-01-15 10:50:13      阅读:271      评论:0      收藏:0      [点我收藏+]

编译安装mysql5.6


mysql wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33.tar.gz

tar -zxvf mysql-5.6.33.tar.gz

下载编译工具 wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

tar -zxvf cmake-2.8.5.tar.gz

cd cmake-2.8.5

安装编译工具 ./bootstrap --prefix=/usr/local/cmake

sudo gmake && sudo gmake install

作一个软链作为全局变量 ln -s /usr/local/cmake/bin/cmake /usr/bin

下载 Boost库 wget http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz

tar -zxvf boost_1_59_0.tar.gz

mkdir /usr/local/boost

mv boost_1_59_0/* /usr/local/boost

sudo groupadd mysql

sudo useradd -g mysql mysql

cd mysql-5.6.33

安装必要工具 yum -y install ncurses-devel

编译安装mysql cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_BOOST=/usr/local/boost

编译错误需要删除 rm CMakeCache.txt 重新编译

sudo make && sudo make install mysql安装完成了 
cd /usr/local/mysql/scripts/

sudo ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

修改配置 sudo vi /usr/local/mysql/my.conf

basedir = /usr/local/mysql datadir = /usr/local/mysql/data
socket = /tmp/mysql.sock

cd /usr/local/mysql/support-files

sudo cp mysql.server /etc/rc.d/init.d/mysqld

添加随系统启动 chkconfig --add mysqld

启动完成 sudo service mysqld start


编译安装mysql5.6

原文:http://blog.51cto.com/346054/2060933

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!