install mysql from source and troubleshooting example
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的更多相关文章
- A very cool thing: Install MYSQL from source without root access on LINUX
最近由于工作的需要,要在centos上安装MYSQL服务器.作为一名小兵中的小兵,当然是没有root权限的,为了能够使用mysql,只能使用源码安装了(因为binary安装方式似乎需要root acc ...
- 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)
这篇文章简述了在Mac OSX狮子(Lion)上安装MySQL Community Server最新版本v10.6.7的过程. MySQL是最流行的开源数据库管理系统.首先,从MySQL的下载页面上下 ...
- Install MySql on CentOS
Installing & Configuring MySQL Server This Howto will show you how to install MySQL 5.x, start t ...
- How to Install MySQL on CentOS 7
CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载 # wget http://dev.mysql.com/get/mysql-communit ...
- gem install mysql遇到问题。解决方案
今天遇到的问题,是使用gem install mysql遇到的.报下面的错误 Building native extensions. This could take a while... ERROR: ...
- Install MySQL on Mac by Homebrew
1. 安装mysql brew update brew install mysql 2. 启动mysql mysql.server start 3. 登录mysql mysql -uroot -p ...
- 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 ...
- ubuntu install mysql server method
recently try to install mysql in my computer so that I can practise some sql statement on seve ...
- mysql加速source导入数据
mysql加速source导入数据 # 进入mysql中执行如下 ; ; ; ; -- 你的sql语句1 -- 你的sql语句2 -- 你的sql语句3 ; ; ; ;
随机推荐
- mysql在查询中常见问题汇总
1.从主从表中查询外键内容(常见问题) 从主从表中查询对应的外键,需要指定外键的表,即sno=> student.sno或者score.sno 错误:select sno,sname,degre ...
- L2-008. 最长对称子串(思维题)*
L2-008. 最长对称子串 参考博客 #include <iostream> using namespace std; int main() { string s; getline(ci ...
- c++ 网络库
1.libevent 2.boost::asio 3.ace boost::asio以前看过,不过忘记了 学习,学习
- 百战程序员9- IO流
1.IO是什么意思? data source是什么意思? IO:输入输出 data source:数据源 2.字节流和字符流有什么区别?输入流和输出流有什么区别? 分类 3.节点流和处理流有什么区别? ...
- 学习笔记TF046:TensoFlow开发环境,Mac、Ubuntu/Linux、Windows,CPU版本、GPU版本
下载TensorFlow https://github.com/tensorflow/tensorflow/tree/v1.1.0 .Tags选择版本,下载解压. pip安装.pip,Python包管 ...
- Javascript 来判断数组的假值如 null false "" NaN
Javascript 来判断数组的假值如 null false "" NaN function bouncer(arr) { arr = arr.filter(function(a ...
- k8s-YAML配置文件(转)
转自http://www.cnblogs.com/bigberg/p/9203619.html 一.YAML基础 YAML是专门用来写配置文件的语言,非常简洁和强大,使用比json更方便.它实质上是一 ...
- 2.1 Visio画图后,粘贴到word白边太宽
如下图所示:Visio2007画图后,图白边距很宽. 右击打开>将鼠标移动到画布边缘,按下Ctrl后鼠标变为双箭头,然后拖拽方格画布,拖拽合适的宽度保存即可.
- Linux系统时钟的更改
linux系统时钟有两个,一个是硬件时钟,即BIOS时间,就是我们进行CMOS设置时看到的时间,另一个是系统时钟,是linux系统Kernel时间. 查看.设置硬件时间: 查看系统硬件时钟 hwclo ...
- 【C++】atof()
转自:https://blog.csdn.net/zhaoyl03/article/details/8176387 atof 是ascII to float的缩写,它将ascII字符串转换为相应的单精 ...