I tried to install MySQL 5.7 from source file and upgrading previous MySQL version to the lastest 5.7.22.

following command record is shared as a note.

not many explanations. If having  any questions, you can make a comment and I will reply when I see it.

## REFERENCE
https://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html#option_cmake_download_boost ## install tools
yum install make gcc-c++ cmake bison-devel ncurses-devel ## create user and dir
id mysql
mkdir /usr/local/mysql
mkdir -p /data/mydb chown -R mysql.mysql /usr/local/mysql
chown -R mysql.mysql /data/mydb ## unzip source package
cd /home/maxwellyang/Desktop/mysql-dev/source_code
tar -zxvf mysql-5.7..tar.gz ## make clean
cd mysql-5.7.
make clean ## run cmake
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ # install dir
-DMYSQL_DATADIR=/data/mydb \ # data dir
-DSYSCONFDIR=/etc \ # my.cnf dir
-DEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DENABLED_LOCAL_INFILE= \
-DEXTRA_CHARSETS=all \
-DDOWNLOAD_BOOST= \ # auto download boost library file
-DWITH_BOOST=/home/maxwellyang/Desktop/mysql-dev/source_code/boost \ # boost library save dir
-DINSTALL_LAYOUT=STANDALONE make make install ## problem encountered after using the compiled version
/etc/init.d/mysqld start # execute failed without writing to mysql error log
bash -x /etc/init.d/mysqld start # to see where script stopped, suspect script maybe error out at /usr/local/mysql/bin/mysqld_safe --datadir=/data/mydb --pid-file=/data/mydb/mysql-dev.pid bash -x /usr/local/mysql/bin/mysqld_safe --datadir=/data/mydb --pid-file=/data/mydb/mysql-dev.pid # suspect script maybe error out at /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mydb --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mydb/.err --pid-file=/data/mydb/mysql-dev.pid --port= /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mydb --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mydb/.err --pid-file=/data/mydb/mysql-dev.pid --port= # this script error with [ERROR] COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'latin1' # now we see problem is related to collation and characterset.
# my previous database charset is latin1, which is the default charset when installing with tar.gz package
# but the default collation for the compiled version is utf8mb4_general_ci, which is not compatible with charset latin1
# plus I don't specify collation-server paramter in /etc/my.cnf
# so one solution is to specify collation-server parameter in /etc/my.cnf, usable options is collation-server=latin1_german1_ci
# then the above /usr/local/mysql/bin/mysqld script can success
# tried the /etc/init.d/mysqld start, can work also.

最新文章

  1. MongoDB分组汇总操作,及Spring data mongo的实现
  2. Java---设计模式app小软件汇总应用
  3. QQ浏览器不支持JS问题
  4. ORA-00600 [kollasg:client-side tmp lob]
  5. php中des加密解密 匹配C#des加密解密 对称加密
  6. 树上差分 (瞎bb) [树上差分][LCA]
  7. JS5模拟类
  8. Android开发技巧——高亮的用户操作指南
  9. C++ 利用流来进行string和其他类的转换
  10. js判断时间是否超过了16:30
  11. SiteMesh3简介及使用
  12. FPGA笔试必会知识点2—FPGA器件
  13. Es6对象的扩展和Class类的基础知识笔记
  14. POJ3076 Sudoku 舞蹈链 DLX
  15. finance1:专业词汇
  16. 微信小程序跳转(当我们不知道是普通页面还是tabbar)
  17. AngularJS中使用$parse或$eval在运行时对Scope变量赋值
  18. dev accordionControl panelcontorl 使用
  19. ORACLE 实用案列
  20. Linux终端里的记录器

热门文章

  1. 11--Python入门--面向对象
  2. sql server中case when的用法
  3. 解决eclipse高版本JDK编译的项目到低版本JDK服务器上不能运行的问题
  4. python中时间、日期、时间戳的转换
  5. 2017第45周一java多线程创建方法
  6. NIO、BIO、AIO区别
  7. c#读sql server数据添加到MySQL数据库
  8. mysqlbinlog基于时间点恢复
  9. win7文件夹带锁标志如何去除?win7去除文件夹带锁标志的方法
  10. Hadoop 管理工具HUE配置-Hive配置