编译安装mysql5.6

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译安装mysql5.6相关的知识,希望对你有一定的参考价值。

编译安装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的主要内容,如果未能解决你的问题,请参考以下文章

mysql5.6.35编译安装

编译安装mysql5.6

编译安装mysql5.6

CentOS7 编译安装MySQL5.6.38

mysql5.6安装

Centos7 编译安装mysql5.6