CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOS 7 上编译安装MySQL 5.6.23大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

1.下载源码 wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.23.tar.gz   2.解压 tar zxvf mysql-5.6.23.tar.gz   3..安装必要的包 sudo yum install cmake gcc-c++ ncurses-devel perl-Data-Dumper  4.进入mysql源码目
@H_944_6@
@H_944_6@

1.下载源码

wgethttp://dev.MysqL.com/get/Downloads/mysql-5.6/mysql-5.6.23.tar.gz

2.解压

tarzxvfmysql-5.6.23.tar.gz

3..安装必要的包

sudoyuminstallcmakegcc-c++ncurses-develperl-Data-Dumper

4.进入MysqL源码目录,@L_218_5@makefile

cmake

5.编译

@H_856_16@make

6.安装

sudomakeinstall

MysqL将会安装到/usr/local/MysqL路径。

7.添加MySQL用户和组

sudogroupaddMysqL

sudouseradd-r-gMysqLMysqL

8.修改目录和文件权限,安装数据库

cd/usr/local/MysqL

sudochown-RMysqL.

sudochgrp-RMysqL.

sudoscripts/MysqL_install_db--user=MysqL

sudochown-Rroot.

sudochown-RMysqLdata

至此,MysqL就可以启动运行了。

9.启动MysqL

CentOS7@L_237_26@mariaDB的支持,/etc下认存在my.cnf文件干扰MysqL运行,需要先删掉

cd/etc

sudorm-frmy.cnfmy.cnf.d

然后再/etc下重建my.cnf文件内容如下



# For advice on how to change setTings please see
# http://dev.MysqL.com/doc/refman/5.6/en/server-configuration-defaults.html

[MysqLd]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MysqL. Start at 70% of @R_253_10586@l 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 = .....
# datadir = /data/MysqL/data
# port = .....
# server_id = .....
# 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

max_connection = 10000
sql_mode = NO_ENGINE_SUBSTITUTION,StriCT_TRANS_TABLES
#binary log
log-bin = MysqL-bin
binlog_format = mixed
expire_logs_day = 30
#slow query log
slow_query_log = 1
slow_query_log_file = /var/log/MysqL/slow.log
long_query_time = 3
log-queries-not-using-indexes
log-slow-admin-statements


修改/usr/local/MysqL my.cnf文件

现在可以启动MysqL

sudo/usr/local/MysqL/bin/MysqLd_safe--user=MysqL&

CentOS7 不能使用service控制MysqL服务,而源码安装的MysqL也没有提供Systemd的控制脚本。

于是编辑/etc/rc.d/rc.local文件添加MysqL的开机启动命令。

@H_228_301@/usr/local/MysqL/bin/MysqLd_safe--user@H_228_301@=MysqL@H_228_301@&

sudochmoda+x/etc/rc.d/rc.local

@H_228_301@

10.修改root密码

/usr/loca/MysqL/bin/MysqL -uroot
use MysqL;
updatE user SET password = passworD('test2015') WHERE user = 'root';

GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'passwd2015';

//开放远程连接权限

grant all PRIVILEGES on db_name.* to 'root'@'123.207.249.146' identified by 'Root123456' WITH GRANT OPTION;

FLUSHPRIVILEGES;

至此,安装基本完成了,一个MysqL就能用了。

大佬总结

以上是大佬教程为你收集整理的CentOS 7 上编译安装MySQL 5.6.23全部内容,希望文章能够帮你解决CentOS 7 上编译安装MySQL 5.6.23所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
猜你在找的CentOS相关文章