mysql5.7安装教程
据说mysql5.7比5.6性能提升了好几倍,而且增加了多线程的主从复制,加快主从的复制速度,
之前版本一个库只能用于一个线程复制,5.7版本一个库可以使用多线程复制,大大提升复制速度。
先安装初始依赖包 yum install gcc gcc-c cmake ncurse-devel -y
凯发k8官网下载客户端中心官网下载最新源码包
wget http://dev.mysql.com/get/downloads/mysql-5.7/mysql-5.7.12.tar.gz
tar -xvf mysql-5.7.12.tar.gz -c /usr/local/src 源码包解压到src下
cd /usr/local/src/mysql-5.7.12 进入目录
cmake ./ 开始编译,可用--help查看可增加的参数,一般都是指定安装目录和存储引擎
编译时候会报错
-- mysql currently requires boost_1_59_0
cmake error at cmake/boost.cmake:81 (message):
you can download it with -ddownload_boost=1 -dwith_boost=
this cmake script will look for boost in . if it is not there,
it will download and unpack it (in that directory) for you.
下载
cd /usr/local/boost
wget
重新编译cmake . -dwith_boost=/usr/local/boost 就可以
make && make install 默认安装在/usr/local/mysql
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql 初始化数据库(这个跟之前版本都不同)
这时候会出现一个密码
[root@localhost mysql]# bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
2016-05-31t05:12:19.053082z 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-31t05:12:19.486968z 0 [warning] innodb: new log files created, lsn=45790
2016-05-31t05:12:19.633715z 0 [warning] innodb: creating foreign key constraint system tables.
2016-05-31t05:12:19.749980z 0 [warning] no existing uuid has been found, so we assume that this is the first time that this server has been started. generating a new uuid: 3fe62aeb-26ee-11e6-bc56-000c295fc509.
2016-05-31t05:12:19.753440z 0 [warning] gtid table is not ready to be used. table 'mysql.gtid_executed' cannot be opened.
2016-05-31t05:12:19.756006z 1 [note] a temporary password is generated for root@localhost: k8=lhohuwwgh
接下来就是常规做法了
cp /usr/local/mysql/support-file/mysql.server /etc/rc.d/init.d/mysqld
cp /usr/local/mysql/support-file/my-default.cnf /etc/my.cnf
/etc/init.d/mysqld start 启动
[root@localhost support-files]# /etc/init.d/mysqld start
starting mysql.. [ ok ]
[root@localhost support-files]# /usr/local/mysql/bin/mysql -uroot -pk8=lhohuwwgh
mysql: [warning] using a password on the command line interface can be insecure.
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 2
server version: 5.7.12
凯发app官方网站 copyright (c) 2000, 2016, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mysql>
第一次进入需要修改root密码
[root@localhost support-files]# /usr/local/mysql/bin/mysqladmin -uroot password "root" -p
enter password:
mysqladmin: [warning] using a password on the command line interface can be insecure.
warning: since password will be sent to server in plain text, use ssl connection to ensure password safety.
登录系统
[root@localhost support-files]# /usr/local/mysql/bin/mysql -uroot -proot
mysql: [warning] using a password on the command line interface can be insecure.
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 11
server version: 5.7.12 source distribution
凯发app官方网站 copyright (c) 2000, 2016, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
mysql>
可以看到版本为5.7.12 源码编译版本
mysql 5.7.12 最新版安装完成
阅读(1549) | 评论(0) | 转发(0) |