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.

install mysql from source and troubleshooting example的更多相关文章

  1. A very cool thing: Install MYSQL from source without root access on LINUX

    最近由于工作的需要,要在centos上安装MYSQL服务器.作为一名小兵中的小兵,当然是没有root权限的,为了能够使用mysql,只能使用源码安装了(因为binary安装方式似乎需要root acc ...

  2. 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)

    这篇文章简述了在Mac OSX狮子(Lion)上安装MySQL Community Server最新版本v10.6.7的过程. MySQL是最流行的开源数据库管理系统.首先,从MySQL的下载页面上下 ...

  3. Install MySql on CentOS

    Installing & Configuring MySQL Server This Howto will show you how to install MySQL 5.x, start t ...

  4. How to Install MySQL on CentOS 7

    CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载   # wget http://dev.mysql.com/get/mysql-communit ...

  5. gem install mysql遇到问题。解决方案

    今天遇到的问题,是使用gem install mysql遇到的.报下面的错误 Building native extensions. This could take a while... ERROR: ...

  6. Install MySQL on Mac by Homebrew

    1.  安装mysql brew update brew install mysql 2. 启动mysql mysql.server start 3. 登录mysql mysql -uroot -p ...

  7. yum install mysql

    rpm -qa|grep -i mysqlmysql-libs-5.1.52-1.1.alios6.1.x86_64mysql-5.1.52-1.1.alios6.1.x86_64mysql-deve ...

  8. ubuntu install mysql server method

         recently try to install mysql in my computer so that  I can practise some sql statement on seve ...

  9. mysql加速source导入数据

    mysql加速source导入数据 # 进入mysql中执行如下 ; ; ; ; -- 你的sql语句1 -- 你的sql语句2 -- 你的sql语句3 ; ; ; ;

随机推荐

  1. How to create your iOS team provisioning profile ?

    From Apple Developer: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppS ...

  2. emmet简单记录

    一.引式符号 html:5 or  ! . class #  id []标签内属性 pycharm不支持  {}标签的内容 pycharm不支持 ()分组标签  pycharm不支持 二.关系符号 1 ...

  3. 关于LaTeX公式排版

    [转载请注明出处]http://www.cnblogs.com/mashiqi 2017/10/05 1.居中括号框住多行公式 \begin{equation*} \left\{\begin{alig ...

  4. C#软件开发实例.私人订制自己的屏幕截图工具(九)使用自己定义光标,QQ截图时的光标

    版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢. https://blog.csdn.net/testcs_dn/article/details/ ...

  5. linux(centos6.9)安装步骤

    http://blog.csdn.net/u012453843/article/details/52819756 https://mirrors.aliyun.com/ 下载想要的版本 2选择新建虚拟 ...

  6. javascript运行机制之执行顺序详解

    1.代码块 指的的是有标签分割的代码段. 例如: <script type="text/javascript"> alert("这是代码块一"); ...

  7. 如何用原生js开发一个Chrome扩展程序

    原文地址:How to Build a Simple Chrome Extension in Vanilla JavaScript 开发一个Chrome扩展程序非常简单,只需要使用原生的js就可以完成 ...

  8. asp.net:mv4 FileResult在IE8中下载不显示文件名和扩展名而显示Action方法名了!

    IE8下,用户点击下载文件,会发现文件类型失丢的问题,解决方案如下: //IE8下载时,只显示action的名字,没有文件名和后缀 @仰止网Simba //return File(bufferbyte ...

  9. dubbo 熔断,限流,降级

    1 写在前面 1.1 名词解释 consumer表示服务调用方 provider标示服务提供方,dubbo里面一般就这么讲. 下面的A调用B服务,一般是泛指调用B服务里面的一个接口. 1.2 拓扑图 ...

  10. [综] meanshift算法

    Meanshift,聚类算法 http://www.cnblogs.com/liqizhou/archive/2012/05/12/2497220.html 记得刚读研究生的时候,学习的第一个算法就是 ...