当前位置:Gxlcms > 数据库问题 > 编译安装mysql5.6

编译安装mysql5.6

时间:2021-07-01 10:21:17 帮助过:15人阅读


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

标签:file   style   eve   base   space   margin   socket   cache   全局   

人气教程排行