MySQL5.7源码安装问题汇总
发表于:2026-10-31 作者:千家信息网编辑
千家信息网最后更新 2026年10月31日,编译安装mysql5.7版本,想试用一下新的版本特性,发现跟之前的5.6版本编译有了一些变化,总结一下避免以后继续入坑。5.6安装方式cmake版本5.7编译cmake要求版本最低为2.8,当前为2.
千家信息网最后更新 2026年10月31日MySQL5.7源码安装问题汇总
编译安装mysql5.7版本,想试用一下新的版本特性,发现跟之前的5.6版本编译有了一些变化,总结一下避免以后继续入坑。5.6安装方式
cmake版本
5.7编译cmake要求版本最低为2.8,当前为2.6,所以需要升级cmake版本。信息如下
shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/dataCMake Error at CMakeLists.txt:21 (CMAKE_MINIMUM_REQUIRED): CMake 2.8.2 or higher is required. You are running version 2.6.4-- Configuring incomplete, errors occurred!shell> cmake --versioncmake version 2.6-patch 4
cmake官网下载地址
shell> tar zxvf cmake-3.2.2.tar.gzshell> cd cmake-3.2.2/shell> ./bootstrapshell> make && make installshell> cmake --versioncmake version 3.2.2
BOOST库
5.7编译需要boost类库,可使用 -DDOWNLOAD_BOOST=1 -DWITH_BOOST= 参数将在指定路径查找,如未找到会指
定下载并解压到指定的路径
问题描述shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data CMake suite maintained and supported by Kitware (kitware.com/cmake).-- Could not find (the correct version of) boost.-- MySQL currently requires boost_1_57_0CMake Error at cmake/boost.cmake:76 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=安装boost库shell> tar jxvf boost_1_57_0.tar.bz2shell> cd boost_1_57_0/shell> ./bootstrap.shshell> ./b2 install安装后目录shell> ls /usr/local/include/boostshell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
mysql_install_db
之前版本mysql_install_db是在mysql_basedir/script下,5.7放在了mysql_install_db/bin目录下,且已被废弃。
shell> cd /db/mysql/mysql_57shell> bin/mysql_install_db --basedir=. --datadir=data --user=mysql[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initializeshell> bin/mysqld --initialize2015-04-21T18:17:53.169216Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2015-04-21T18:17:58.702510Z 0 [Warning] InnoDB: New log files created, LSN=457902015-04-21T18:17:59.538811Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2015-04-21T18:17:59.646010Z 0 [Warning] Failed to setup SSL2015-04-21T18:17:59.646105Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key2015-04-21T18:17:59.663795Z 1 [Warning] A temporary password is generated for root@localhost: rq/Oh8VWs1Yh
shell>/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ |
初始化密码
mysql5.7会生成一个初始化密码,而在之前的版本首次登陆不需要登录。
shell> cat /root/.mysql_secret # Password set for user 'root@localhost' at 2015-04-22 22:13:23 ?G5W&tz1z.cN修改默认密码shell> bin/mysqladmin -h localhost -u root password '123@qwe' -p'?G5W&tz1z.cN'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.
另外mysql5.7的mysql.user表结构被修改
修改mysql.user方式修改密码mysql> update mysql.user set authentication_string=password('123qwe') where user='svoid' and Host = 'localhost';Query OK, 1 row affected (0.01 sec)Rows matched: 1 Changed: 1 Warnings: 0mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)整理自:http://blog.itpub.net/29733787/viewspace-1590891/
版本
密码
编译
方式
目录
路径
问题
最低
信息
参数
地址
数据
数据库
是在
特性
结构
次登
升级
变化
生成
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
百单网互联网科技有限公司
互联网科技产业
互联网科技公司华为
深圳恒合互联网络科技有限公司
科技互联网项目
互联网与科技金融数据
腾讯阿里互联网科技
迪茉互联网科技
艾特科技互联网
致聘互联网科技
苏州大垚互联网科技
华脉科技工业互联网产品
济南华为互联网科技产业总部基地
温州喔噻互联网科技有限公司
乌苏新华互联网科技做什么的
迪庆互联网科技招生
中科明德北京互联网科技
江苏互联网智能科技产品出厂价
艺电能源互联网科技有限公司招聘
科技互联网专业务虚会材料
互联网科技活动banner
互联网科技视频
融势互联网科技
中正互联网科技招聘
海南科技产业互联网平台
承德科技产业互联网发展
健康食品互联网创新科技园项目
企晟互联网信息科技有限公司
济南小医互联网科技有限公司招聘
上海互联网科技园景观