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. C# 读写西门子PLC数据,包含S7协议和Fetch/Write协议,s7支持200smart,300PLC,1200PLC,1500PLC

    本文将使用一个gitHub开源的组件技术来读写西门子plc数据,使用的是基于以太网的TCP/IP实现,不需要额外的组件,读取操作只要放到后台线程就不会卡死线程,本组件支持超级方便的高性能读写操作 官方 ...

  2. CSS设置全局字体

    在样式表或者页面head加上这个就可以了.分别是字体,字号,颜色,行高,总之要什么就写什么. body,td,th {font-family: Verdana, Arial, Helvetica, s ...

  3. 本地maven库导入架包

    mvn install:install-file -DgroupId=com.alipay -DartifactId=sdk-java -Dversion=20170725114550 -Dpacka ...

  4. Lua IDE工具-Intellij IDEA+lua插件配置教程(Chianr出品)

    Lua 编译工具IDE-Intellij IDEA 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Ch ...

  5. javascript页面常用事件

    事件名称 描述 onload和 onunload(已过时) 当用户进入或离开页面时就会触发onload和onunload事件,onload是页面所有元素都加载完之后才加载onload onfocus, ...

  6. jQuery 点击后退(返回)执行函数

    <html> <head> <meta charset="UTF-8"> <meta name="viewport" ...

  7. Spring boot 配置 mybatis xml和动态SQL 分页配置

    更新时间 2018年4月30日23:27:07 1.pom.xml <?xml version="1.0" encoding="UTF-8"?> & ...

  8. Java继承(下)

    Object类 在www.oracle中找到java 中的java.lang在中找到object类中找到可以看到在java语言中的定义 如何修改object中的equals类及测试 在object中类 ...

  9. TCP/IP学习20180629-数据链路层-ARP、IP

    1.数据链路层:IP.ARP.RARPARP协议用来找到目标主机的Ethernet网卡Mac地址,IP协议用来承载数据ARP协议找到目标,IP协议传输数据2.IP协议ip协议是TCP/IP协议的核心, ...

  10. windows copy 和xcopy

    #将文件夹下文件拷贝到指定目录 将d盘下1文件夹内所有内容拷贝到测试目录下copy d:\1\ Z:\chenkai\测试目录\ /yxcopy D:\soft\svn工具 Z:\chenkai\测试 ...