当前位置 : 主页 > 网络编程 > 其它编程 >

centos6.8编译安装mysql

来源:互联网 收集:自由互联 发布时间:2023-07-02
1.首先下载mysql的源码包wgethttp:down1.chinaunix.netdistfilesmysql-5.5.20.tar.gz2.安装需要的编译工具 1.首先下载mysql的源码包 wgethttp://down1.chinaunix.net/distfiles/mysql-5.5.20.tar.gz 2.安装需要的编译工具 y
1.首先下载mysql的源码包wgethttp:down1.chinaunix.netdistfilesmysql-5.5.20.tar.gz2.安装需要的编译工具

1.首先下载mysql的源码包

wgethttp://down1.chinaunix.net/distfiles/mysql-5.5.20.tar.gz

2.安装需要的编译工具

yum install cmake make ncurses-devel ncurses gcc gcc-c++ -y

3.解压源码包

tar -zxvf mysql-5.5.20.tar.gzcd mysql-5.5.20

4.开始编译安装

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56/-DMYSQL_UNIX_ADDR=/tmp/mysql.sock-DMYSQL_DATADIR=/data/mysql/-DSYSCOnFDIR=/etc-DMYSQL_USER=mysql-DMYSQL_TCP_PORT=3306-DWITH_XTRADB_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_PARTITION_STORAGE_ENGINE=1-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_READLINE=1-DENABLED_LOCAL_INFILE=1-DWITH_EXTRA_CHARSETS=1-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DEXTRA_CHARSETS=all-DWITH_BIG_TABLES=1-DWITH_DEBUG=0`

makemake install

5.设置开机启动和配置文件

cd /usr/local/mysql56/cp support-files/my-large.cnf/ etc/my.cnfcp support-files/mysql.server /etc/init.d/mysqldchkconfig –add mysqldchkconfig –level 35 mysqld onmkdir -p /data/mysqluseradd mysql

6.初始化

/etc/init.d/mysqld/usr/local/mysql56/scripts/mysql_install_db –user=mysql –datadir=/data/mysql/ –basedir=/usr/local/mysql56/ln -s /usr/local/mysql55/bin/* /usr/bin/

ok,到此mysql就编译安装完成,可用命令ps -ef |grep mysql查看mysql是否启动。

【本文由:香港云服务器 http://www.558idc.com/ne.html网络转载请说明出处】
上一篇:新手问一个正则表达式的问题
下一篇:没有了
网友评论