Centos7 编译安装mysql5.6
来源:互联网 发布:js 分享 编辑:程序博客网 时间:2024/05/20 20:18
安装编译mysql所需要的软件
yum install gcc gcc-c++ ncurses-devel perl -ywget https://cmake.org/files/v3.9/cmake-3.9.0.tar.gztar xzvf cmake-3.9.0.tar.gzcd cmake-3.9.0/./bootstrap makemake install
创建mysql用户,安装目录和数据目录
groupadd mysqluseradd -r -g mysql mysql mkdir -p /usr/local/mysql mkdir -p /data/mysqldb
下载mysql5.6的源码
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz tar xzvf mysql-5.6.16.tar.gz cd mysql-5.6.16/
编译安装
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1rm CMakeCache.txtmakemake install
修改mysql目录所有者和组
cd /usr/local/mysql/chown -R mysql:mysql .cd /data/mysqldb/chown -R mysql:mysql .
初始化数据
cd /usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysqldb
可能遇到问题
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./mysql_install_db line 42. BEGIN failed--compilation aborted at ./mysql_install_db line 42.
解决方法
yum install 'perl(Data::Dumper)' -y
修改mysql配置文件
cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnfcp support-files/mysql.server /etc/init.d/mysqld vim /etc/my.cnf[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required. basedir = /usr/local/mysql datadir = /data/mysqldb/ port = 3306 server_id = 136# socket = .....# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
加入path路径
vim /etc/profile在最后添加 PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH export PATH source /etc/profile
启动mysql
service mysqld start
登录mysql
mysql -uroot
阅读全文
0 0
- Centos7 编译安装mysql5.6
- centos7上编译安装MYSQL5.6
- CentOS7 编译安装MySQL5.6.22
- CentOS7编译安装MySQL5.7.10
- centos7 mysql5.7编译安装
- centos7 编译安装mysql5.7+
- centos7编译安装mysql5.7
- Centos7编译安装mysql5.7.18
- CentOS7安装Mysql5.6
- CentOS7安装mysql5.6
- centos7 安装mysql5.6
- CentOS7安装mysql5.6
- centos7 mysql5.6安装
- centos7安装mysql5.6
- Centos7安装mysql5.6
- centos7 安装mysql5.6
- Centos7安装mysql5.6
- Centos7 安装mysql5.6
- Hdu-6071 Lazy Running(trick最短路)
- Access导入MDB文件
- HTML5_表单的补充、浮动框架、谷歌专用标签、高亮标签
- centos下的中文分词coreseek-4.1的编译安装与基本配置
- spring requestmapping produce consume
- Centos7 编译安装mysql5.6
- 全景图的各种制作方法~~
- Face The Right Way POJ
- 教你将CAD转成PDF黑白色
- bzoj1616 [Usaco2008 Mar]Cow Travelling游荡的奶牛(dp)
- 小错误
- VUE 开发总结笔记
- android 页面底部弹出菜单(dialog)
- format详解