CentOs6.5系统下MySQL-5.7.19安装

前端之家收集整理的这篇文章主要介绍了CentOs6.5系统下MySQL-5.7.19安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

好长时间没有更新了,今天给大家分享一波简单的文档,菜鸟的入门精神就是不断的学习,不断地找大神帮助!!!!

在这里今天给大家推荐一个博文地址:http://sumongodb.blog.51cto.com/

好了!废话少说,干活走起来!!!!!!!!


CentOs6.5下MysqL5.7.19二进制安装是我自己编译的官方源码包


首先我们把一些依赖包安装上:

yum-ygroupinstall"Developmenttools"
yum-yinstallncursesncurses-developenssl-develbisongccgcc-c++make

解压MysqL二进制安装包:

tar-zxvfMysqL-5.7.19.tar.gz-C/usr/local/MysqL

编辑my3306.cnf

vim/etc/my3306.cnf

[client]
port=3306
socket=/tmp/MysqL3306.sock
default_character_set=utf8
[MysqLd]
lower_case_table_names=1
port=3306
basedir=/usr/local/MysqL
datadir=/home/MysqL3306/MysqL3306
socket=/tmp/MysqL3306.sock
pid_file=/home/MysqL3306/MysqL.pid
tmpdir=/tmp/
skip_name_resolve=1
character_set_server=utf8
collation_server=utf8_unicode_ci
max_connections=512
max_connect_errors=100000
interactive_timeout=600
wait_timeout=600
table_open_cache=2048
query_cache_type=0
#query_cache_size=64M
#query_cache_limit=2M
thread_cache_size=51
max_allowed_packet=16M
tmp_table_size=256M
max_tmp_tables=128
max_heap_table_size=96M
sort_buffer_size=4M
read_buffer_size=4M#顺序IO
join_buffer_size=4M
read_rnd_buffer_size=8M#随机IO
bulk_insert_buffer_size=64M#
default_storage_engine=InnoDB
log_bin=/home/MysqL3306/logs/MysqL-bin
expire_logs_days=7
binlog_format=row
log_slave_updates=1
log_error=/home/MysqL3306/logs/MysqL-error.log
slow_query_log=1
slow_query_log_file=/home/MysqL3306/logs/MysqL-slow.log
long_query_time=1
log_output=FILE
log_queries_not_using_indexes=1

max_binlog_cache_size=8M
max_binlog_size=1024M
binlog_cache_size=4M
sync_binlog=1
server_id=15133306


#innodb
innodb_data_home_dir=/home/MysqL3306/MysqL3306/
innodb_data_file_path=ibdata1:512M:autoextend
innodb_log_group_home_dir=/home/MysqL3306/MysqL3306
innodb_buffer_pool_instances=1
innodb_buffer_pool_size=500M
innodb_buffer_pool_dump_pct=40
innodb_page_cleaners=4
innodb_log_file_size=256M
innodb_log_files_in_group=2
innodb_log_buffer_size=32M#default16M
innodb_flush_log_at_trx_commit=1
innodb_lock_wait_timeout=30
innodb_undo_directory=/home/MysqL3306/MysqL3306/
innodb_undo_logs=128#must>=35.default128
innodb_undo_tablespaces=3#must>=2
innodb_undo_log_truncate=1
innodb_max_undo_log_size=1000M
innodb_purge_rseg_truncate_frequency=128
innodb_print_all_deadlocks=1
innodb_buffer_pool_load_at_startup=1
innodb_buffer_pool_dump_at_shutdown=1
innodb_open_files=65536
innodb_file_per_table=1
innodb_lock_wait_timeout=30
innodb_read_io_threads=8
innodb_write_io_threads=8
innodb_io_capacity=200
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_purge_threads=4
innodb_support_xa=1
innodb_max_dirty_pages_pct=75
transaction_isolation=REPEATABLE-READ
#rep
slave-parallel-type=LOGICAL_CLOCK
slave-parallel-workers=16
master_info_repository=TABLE
relay_log_info_repository=TABLE
relay_log_recovery=ON
[MysqLdump]
max_allowed_packet=16M
[MysqL]
default_character_set=utf8

创建MysqL用户

useraddMysqL

创建MysqL相关数据目录

mkdir-p/home/MysqL3306/msyql3306
mkdit-p/home/MysqL3306/logs

MysqL相关目录进行授权

chown-RMysqL:MysqL/home/MysqL3306
chown-RMysqL:MysqL/usr/local/MysqL

初始化MysqL

/usr/local/MysqL/bin/MysqLd--defaults-file=/etc/my3306.cnf--initialize-insecure--explicit_defaults_for_timestamp--basedir=/usr/local/MysqL--datadir=/home/MysqL3306/MysqL3306/--user=MysqL

启动MysqL

/usr/local/MysqL/bin/MysqLd_safe--defaults-file=/etc/my3306.cnf--datadir=/home/MysqL3306/MysqL3306/--user=MysqL&

配置环境变量

vim/etc/profile

exportPATH=$PATH:/usr/local/MysqL/bin

进入MysqL

MysqL-S/tmp/MysqL3306.sock

修改MysqL用户密码

MysqL>UPDATEuserSETauthentication_string=password('root123')WHEREUser='root'ANDHost='localhost';
原文链接:https://www.f2er.com/centos/375978.html

猜你在找的CentOS相关文章