一、安装mysql
运行环境:
系统版本 | CentOS-7-x86_64-DVD-1503-01(系统已配置网络,可连接外网,为下面使用yum安装依赖包准备) |
软件版本 | mysql-5.6.20.tar.gz |
准备工作:
1、下载mysql-5.6.20.tar.gz源码安装包
下载地址 | http://pan.baidu.com/s/1mgq2gpa |
提取密码 | syy3 |
2、拷贝安装包到 /usr/local/mysql文件夹(没有文件夹可使用命令mkdir mysql来创建该文件夹)
3、检查系统是否已安装过msql
[[email protected] mysql]# rpm -qa|grep mysql //如果已安装,使用以下命令卸载 [[email protected] mysql]# rpm -e --nodeps 文件名
编译安装:
1、解压
[[email protected] mysql]# tar -xvzf mysql-5.6.20.tar.gz
2、安装mysql所依赖的包
[[email protected] mysql]# yum -y install make gcc-c++ cmake bison-devel ncurses-devel libaio [[email protected] mysql]# yum install libaio libaio-devel -y [[email protected] mysql]# yum install perl-Data-Dumper -y [[email protected] mysql]# yum install net-tools -y
3、编译
[[email protected] mysql]# cd mysql-5.6.20/ [[email protected] mysql-5.6.20]# cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_DATADIR=/usr/local/mysql/data \-DSYSCONFDIR=/etc \-DWITH_MYISAM_STORAGE_ENGINE=1 \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DWITH_MEMORY_STORAGE_ENGINE=1 \-DWITH_READLINE=1 \-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \-DMYSQL_TCP_PORT=3306 \-DENABLED_LOCAL_INFILE=1 \-DWITH_PARTITION_STORAGE_ENGINE=1 \-DEXTRA_CHARSETS=all \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci
4、至此,mysql安装成功!
可能出现的问题:--Configuring incomplete,errors orrcurred!
解决方案:
1、下载ncurses-devel
2、删除CMakeCache.txt
3、安装ncurses-devel
4、重新编译
[[email protected] mysql-5.6.20]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
二、配置msql
时间: 2024-10-24 11:11:46