Linux 下 MySQL 5.6安装、运行

5.6和5.7安装有不同,暂时没有时间研究,先记录。

1、5.6版本下载:

wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.46-linux-glibc2.12-x86_64.tar.gz

2、安装差异
a、5.6 初始化db

./mysql_install_db --basedir=/usr/local/mysql --datadir=/data/db/mysql --defaults-file=/etc/my.cnf --user=mysql

/usr/local/mysql/bin/mysqladmin -u root password ''

b、5.7初始化db

bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/db/mysql --pid-file=/usr/local/mysql/mysql.pid
bin/mysql_ssl_rsa_setup  --datadir=/data/db/mysql

3、密码设置差异
a、5.6

/usr/local/mysql/bin/mysqladmin -u root password ''

b、5.7

update user set authentication_string=password('.嘻嘻嘻嘻嘻嘻) where User='root'; 
update user set password_expired='N' where user='root';  

4、配置差异
5.7中有部分配置项,5.6的不支持。
对比 5.7中的my.cnf配置文件:5.7mysql安装

5.6版本临时使用配置

[client]
port    = port
socket    = /usr/local/mysql/mysql.sock
default-character-set = utf8mb4

[mysqld]
default-time_zone = '+8:00'

user    = mysql
port    = port
socket    = /usr/local/mysql/mysql.sock
server-id = 5
pid-file = /usr/local/mysql/mysql.pid
basedir    = /usr/local/mysql
datadir    = /data/db/mysql/
log-error = /usr/local/mysql/logs/error.log

character_set_server = utf8mb4
collation_server = utf8mb4_bin
back_log = 1024
explicit_defaults_for_timestamp = ON
lower_case_table_names = 0

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 


interactive_timeout = 600
wait_timeout = 3600
default_storage_engine = InnoDB
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值