Azure Lei Zhang的博客

weibo: LeiZhang的微博/QQ: 185165016/QQ群:319036205/邮箱:leizhang1984@outlook.com/TeL:139-161-22926

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

  《Windows Azure Platform 系列文章目录

 

  

#UNINSTALL MYSQL PACKAGES
yum remove mysql mysql-server


#ROMOVE MYSQL DIRECTORY
mv /var/lib/mysql /var/lib/mysql_bkup


Installing mysql 5.7 on centos 6

1. download yum repo
    wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm

2. install yum repo
    yum -y localinstall mysql57-community-release-el6-7.noarch.rpm

3. verify yum repo
    yum repolist enabled | grep "mysql.*-community.*"

3a. to enable/disable a particular release
# yum-config-manager --disable mysql57-community
# yum-config-manager --enable mysql56-community


4. install 
    yum -y install mysql-community-server --nogpgcheck
    service mysqld start
    service mysqld status
    mysql --version


5. securing the installation
    grep 'temporary password' /var/log/mysqld.log
    mysql_secure_installation --> follow the prompts
        remove anonymouse users
        disallow root remote login

6. Login mysql -u root -p
  #在提示Enter password中,输入步骤5 grep的密码
7.reset default password
set password for root@localhost = password('123');


8. 检查MySQL是否开机自动启动
chkconfig --list | grep mysqld


9. 设置MySQL开启自动启动
  chkconfig mysqld on

  
Useful links:
http://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html
http://www.tecmint.com/install-latest-mysql-on-rhel-centos-and-fedora/

 

 

  配置MySQL

# For advice on how to change settings please see 
# http://dev.mysql.com/doc/refman/5.7/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 total 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 
# 
# 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 
datadir=/data1/mysql 
socket=/var/lib/mysql/mysql.sock 
# Disabling symbolic-links is recommended to prevent assorted security risks 
symbolic-links=0 
log-error=/var/log/mysqld.log 
pid-file=/var/run/mysqld/mysqld.pid 
max_connections=40960 
innodb_buffer_pool_size=100G 
innodb_log_files_in_group=5 
innodb_log_file_size=1G 
innodb_buffer_pool_instances=32 
innodb_flush_neighbors=1 
table_open_cache=81920 
table_open_cache_instances=64 
thread_cache_size=320 
open_files_limit=65535 
innodb_open_files=65535 
innodb_page_size=16k 
innodb_io_capacity=20000 
innodb_io_capacity_max=50000 
innodb_old_blocks_pct=38 
innodb_old_blocks_time=1000 
innodb_read_ahead_threshold=56 
innodb_random_read_ahead=OFF 
innodb_buffer_pool_dump_pct=25 
bulk_insert_buffer_size=800m 
innodb_flush_log_at_trx_commit=0 
sync_binlog=0 
[client] 
socket=/var/lib/mysql/mysql.sock 
#socket=/data1/mysql/mysql.sock

 

posted on 2021-03-19 23:32  Lei Zhang的博客  阅读(59)  评论(0编辑  收藏  举报