How to install MySQL 5.7 on CentOS 7.3

mkdir -p /home/tools
cd /home/tools
yum -y install numactl libaio
wget http://god.nongdingbang.net/downloads/mysql-5.7-el7.tgz && tar zxvf mysql-5.7-el7.tgz
rpm -Uvh *rpm
mkdir -p /data/{mysql_data,mysql_log,mysql_slow,mysql_undo}
chown -R mysql.mysql /data/*
cat >/etc/my.cnf<<EOF
[client]
port=3306
socket=/tmp/mysql.sock
[mysql]
no-auto-rehash
[mysqld]
port=3306
character-set-server=utf8
socket=/tmp/mysql.sock
datadir=/data/mysql_data
explicit_defaults_for_timestamp=true
lower_case_table_names=1
sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION‘
back_log=103
max_connections=3000
max_connect_errors=100000
table_open_cache=512
external-locking=FALSE
max_allowed_packet=32M
sort_buffer_size=2M
join_buffer_size=2M
thread_cache_size=51
query_cache_size=32M
#query_cache_limit=4M
transaction_isolation=REPEATABLE-READ
tmp_table_size=96M
max_heap_table_size=96M
log-error=/data/mysql_log/error.log
###***slowqueryparameters
long_query_time=2
slow_query_log=1
slow_query_log_file=/data/mysql_slow/slow.log
###***binlogparameters
log-bin=mysql-bin
binlog_cache_size=4M
max_binlog_cache_size=4096M
max_binlog_size=1024M
binlog_format=ROW
binlog_row_image=minimal
expire_logs_days=3
sync_binlog=0
###***undolog
innodb_undo_directory=/data/mysql_undo
innodb_undo_logs=128
innodb_undo_tablespaces=4
innodb_undo_log_truncate=1
innodb_max_undo_log_size=1G
innodb_purge_rseg_truncate_frequency
#***MyISAMparameters
key_buffer_size=16M
read_buffer_size=1M
read_rnd_buffer_size=16M
bulk_insert_buffer_size=1M
###***master-slavereplicationparameters
server-id=1
#slave-skip-errors=all
#***Innodbstorageengineparameters
innodb_buffer_pool_dump_at_shutdown=1
innodb_buffer_pool_load_at_startup=1
innodb_buffer_pool_size=16G
innodb_data_file_path=ibdata1:10M:autoextend
#innodb_file_io_threads=8
innodb_thread_concurrency=0
innodb_flush_log_at_trx_commit=0
innodb_log_buffer_size=16M
innodb_log_file_size=512M
innodb_log_files_in_group=2
innodb_max_dirty_pages_pct=75
innodb_buffer_pool_dump_pct=50
innodb_lock_wait_timeout=50
innodb_file_per_table=on
innodb_flush_neighbors=1
innodb_io_capacity_max = 2000
wait_timeout = 14400
interactive_timeout = 14400
[mysqldump]
quick
max_allowed_packet=32M
 
[myisamchk]
key_buffer=16M
sort_buffer_size=16M
read_buffer=8M
write_buffer=8M
 
[mysqld_safe]
open-files-limit=8192
log-error=/data/mysql_log/error.log
pid-file=/data/mysql_data/mysqld.pid
EOF

## Initialize MySQL configuration
mysqld --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql_data --initialize-insecure

## Start mysql
systemctl restart mysqld && systemctl enable mysqld

## Setting root‘s password for mysql
##############################################
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘[email protected]‘;
mysql> select user,host,authentication_string,password_expired from user;
时间: 2024-11-07 05:52:02

How to install MySQL 5.7 on CentOS 7.3的相关文章

Install MySQl 5.6 on CentOS 6.5

rpm -e --nodeps mysql-libsyum -y install libaiorpm -ivh MySQL-shared-compat-5.6.20-1.el6.x86_64.rpm rpm -ivh MySQL-shared-5.6.20-1.el6.x86_64.rpm rpm -ivh MySQL-server-5.6.20-1.el6.x86_64.rpm rpm -ivh MySQL-client-5.6.20-1.el6.x86_64.rpm service mysq

How to Install MySQL on CentOS 7

How to Install MySQL on CentOS 7 Updated Thursday, August 27th, 2015 by Linode Use promo code DOCS10 for $10 credit on a new account. Try this Guide Contribute on GitHub View Project | View File | Edit File MySQL is a popular database management syst

Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

1. Change root user Bash su - ## OR ## sudo -i 2. Install MySQL YUM repository Fedora Bash ## Fedora 25 ## dnf install https://dev.mysql.com/get/mysql57-community-release-fc25-9.noarch.rpm ## Fedora 24 ## dnf install https://dev.mysql.com/get/mysql57

Install PHP 7, Apache, MySQL 5.6 on CentOS / RHEL 7.1 &amp; 6.7 + Wordpress

最近做了个小项目,挣了几百块钱,于是买了个域名:shawshining.com 和一个搬瓦工的服务器.搬瓦工自带CentOS6,支持一键安装ss,比较方便.买的搬瓦工的服务器只有500MB内存,导致出现一些以前在类似阿里云的学生机1g内存上根本不会出现的问题.所以有必要告诉后来人怎么填坑.事不宜迟,写个教程让大家少走点弯路.如果有问题,清查看最下面的问题解决方法.如果问题依然没有解决可以google,百度一下! 主要参考:https://tecadmin.net/install-php-7-ap

install mysql in centos and change passoword

Install mysql Installing MySQL wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm md5sum mysql57-community-release-el7-9.noarch.rpm rpm -ivh mysql57-community-release-el7-9.noarch.rpm yum install mysql-server Starting MySQL sys

How to Install MySQL 5.6 from Official Yum Reposit

Tags: MySQL Distribution: CentOS Submitted by: Morgan TockerMySQL Community Manager @ Oracle Introduction In October 2013, the MySQL development team officially launched support for yum repositories. This means that you can now ensure that you have t

install zabbix-2.2.5 on CentOS 6.5 x86_64

install zabbix_server: # yum install mysql-server httpd php # yum install mysql-devel gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml downloads zabbix-2.2.5.tar.gz # tar -zxvf zabbix-2.2.5.tar.gz # groupadd  za

mysql集群安装(centos)

永不放弃,一切皆有可能!!! 只为成功找方法,不为失败找借口! mysql集群安装(centos) mysql cluster : 1. 基于NDB Cluster 的分布式数据库系统 2. mysql集群中各服务器节点不共享数据 3. 在mysql cluster中节点指的是进程,区别于其他的集群中节点指的是计算机的情况, 因而在单台计算机上可以有任意多的节点 4. 三种节点: 1)管理节点: 管理cluster内其他节点; 包括启动,停止, 备份,配置等; 在启动其他节点前需要先启动管理节点

Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin

Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin 1 year ago -  by Daniel -  howto centos virtualmin ffmpeg ffmpeg-php The other day I was requested to set-up few requirements for a client such as mod_rewrite, GD library, PHP Dom, bcmath etc.