首页 > 代码库 > MySQL-5.6.32 安装部署

MySQL-5.6.32 安装部署

1.安装MySQL基础及依赖软件

yum install ncurses-devel libaio-devel -ycd /usr/local/srcwget http://www.cmake.org/files/v3.2/cmake-3.2.3.tar.gz --no-check-certificatetar -zxvf cmake-3.2.3.tar.gzcd cmake-3.2.3./configuregmakegmake install# 添加系统用户及目录useradd -r mysql -s /sbin/nologinmkdir /data/mysql/data -p

2.下载安装MySQL

cd /usr/local/srcwget ftp://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/mysql-5.6.32.tar.gztar -zxvf mysql-5.6.32.tar.gzcd mysql-5.6.32cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.6.32 -DMYSQL_DATADIR=/data/mysql/data -DMYSQL_UNIX_ADDR=/data/mysql/data/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DENABLE_DOWNLOADS=1 -DWITH_ZLIB=bundled -DWITH_READLINE=1 -DWITH_EMBEDDED_SERVER=1 -DWITH_DEBUG=0make && make install

3.初始化及配置文件

ln -s /usr/local/mysql-5.6.32/ /usr/local/mysql# 初始化数据库/usr/local/mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql --datadir=/data/mysql/data/ --user=mysql\cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldchown -R mysql.mysql /data/mysql/data/# 配置环境变量echo ‘PATH="/usr/local/mysql/bin:$PATH"‘ >> /etc/profilesource /etc/profile# 设置MySQL用户密码/usr/local/mysql/bin/mysqladmin -u root password ‘123‘

4.启动数据

[root@zabbix mysql-5.6.32]# /etc/init.d/mysqld startStarting MySQL. SUCCESS! [root@zabbix mysql-5.6.32]# mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.32 Source distributionCopyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql> 

 

MySQL-5.6.32 安装部署