linux(centOS7)MySql8.0 生产库二进制安装

环境准备:

操作系统:CentOS 7.3

数据库安装包:MySql 8.0 (二进制安装包)

 

第一步:准备好自己的安装脚本

第二步:进入操作系统,建立用户和安装目录

第三步:进入数据库软件目录,解压安装包,设置环境变量

拷贝解压后的文件,复制到你的软件安装目录

复制数据库启动文件去操作系统启动文件夹下,并且设置临时环境变量和改变安装目录权限

设置永久环境变量,编辑vi /etc/profile文件,在最后一行加入

第四步:安装mysql服务

进入安装目录

安装mysql数据库服务

第五步:配置mysql参数文件my.cnf,便捷my.cnf

8G配置参数文件如下:

[client]
port = 3306
socket = /data/mysql/tmp/mysql.sock

[mysqldump]
quick
max_allowed_packet = 64M

[mysqld_safe]
log_error = /data/mysql/log/error.log
pid_file = /data/mysql/mysqld.pid

[mysql]
no-auto-rehash

[mysqld]
server_id = 1
user = mysql
port = 3306
mysqlx_port = 33060
mysqlx_socket =/data/mysql/tmp/mysqlx.sock
socket = /data/mysql/tmp/mysql.sock
basedir = /data/servers/mysql
datadir = /data/mysql/data

lower_case_table_names = 1
character_set_server = utf8
collation_server = utf8_unicode_ci

innodb_undo_directory = /data/mysql/undo
innodb_undo_tablespaces = 4
innodb_data_file_path = ibdata1:512M:autoextend
innodb_page_size=16k


default_authentication_plugin = mysql_native_password

open_files_limit = 10240
back_log = 600   
max_connections = 3000   
max_connect_errors = 6000  
table_open_cache = 1000
max_allowed_packet = 64M  
sort_buffer_size = 2M
join_buffer_size = 2M   
thread_cache_size = 300 

thread_stack = 256K  
transaction_isolation = READ-COMMITTED  
tmp_table_size = 256M
max_heap_table_size = 256M
long_query_time = 2
log_bin = /data/mysql/tmp/mysql-bin
binlog_cache_size = 4M
max_binlog_cache_size = 8M
max_binlog_size = 1G
binlog_expire_logs_seconds = 2592000
key_buffer_size = 2048M 
read_buffer_size = 1M 
read_rnd_buffer_size = 16M   
bulk_insert_buffer_size = 64M 
skip_name_resolve


innodb_buffer_pool_size = 6144M   
innodb_thread_concurrency = 8   
innodb_flush_log_at_trx_commit = 2 
innodb_log_buffer_size = 16M  
innodb_log_file_size = 128M 
innodb_log_files_in_group = 3   
innodb_max_dirty_pages_pct = 90  
innodb_lock_wait_timeout = 120  
innodb_file_per_table = 1

第六步:设置启动文件和添加对应mysql服务

启动mysql

添加mysql服务

linux(centos 7) 二进制mysql8.0安装 就这么简单!

你可能感兴趣的:(MYSQL之个人成长记录)