CentOs6.5系统下MySQL-5.7.19安装

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

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

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

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


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


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

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

解压@R_301_198@二进制安装包:

tar-zxvf@R_301_198@-5.7.19.tar.gz-C/usr/local/@R_301_198@

编辑my3306.cnf

vim/etc/my3306.cnf

[client]
port=3306
socket=/tmp/@R_301_198@3306.sock
default_character_set=utf8
[@R_301_198@d]
lower_case_table_names=1
port=3306
basedir=/usr/local/@R_301_198@
datadir=/home/@R_301_198@3306/@R_301_198@3306
socket=/tmp/@R_301_198@3306.sock
pid_file=/home/@R_301_198@3306/@R_301_198@.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/@R_301_198@3306/logs/@R_301_198@-bin
expire_logs_days=7
binlog_format=row
log_slave_updates=1
log_error=/home/@R_301_198@3306/logs/@R_301_198@-error.log
slow_query_log=1
slow_query_log_file=/home/@R_301_198@3306/logs/@R_301_198@-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/@R_301_198@3306/@R_301_198@3306/
innodb_data_file_path=ibdata1:512M:autoextend
innodb_log_group_home_dir=/home/@R_301_198@3306/@R_301_198@3306
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/@R_301_198@3306/@R_301_198@3306/
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
[@R_301_198@dump]
max_allowed_packet=16M
[@R_301_198@]
default_character_set=utf8

创建@R_301_198@用户

useradd@R_301_198@

创建@R_301_198@相关数据目录

mkdir-p/home/@R_301_198@3306/msyql3306
mkdit-p/home/@R_301_198@3306/logs

给@R_301_198@相关目录进行授权

chown-R@R_301_198@:@R_301_198@/home/@R_301_198@3306
chown-R@R_301_198@:@R_301_198@/usr/local/@R_301_198@

初始化@R_301_198@

/usr/local/@R_301_198@/bin/@R_301_198@d--defaults-file=/etc/my3306.cnf--initialize-insecure--explicit_defaults_for_timestamp--basedir=/usr/local/@R_301_198@--datadir=/home/@R_301_198@3306/@R_301_198@3306/--user=@R_301_198@

启动@R_301_198@

/usr/local/@R_301_198@/bin/@R_301_198@d_safe--defaults-file=/etc/my3306.cnf--datadir=/home/@R_301_198@3306/@R_301_198@3306/--user=@R_301_198@&

配置环境变量

vim/etc/profile

exportPATH=$PATH:/usr/local/@R_301_198@/bin

进入@R_301_198@

@R_301_198@-S/tmp/@R_301_198@3306.sock

修改@R_301_198@用户密码

@R_301_198@>UPDATEuserSETauthentication_string=password('root123')WHEREUser='root'ANDHost='localhost';

猜你在找的CentOS相关文章