mysql5.7 存储二进制_MySQL5.7二进制安装包

1.从清华大学开源软件镜像站下载二进制包

wget https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-5.7.28-el7-x86_64.tar.gz

2.解压缩&重命名

tar -xvf mysql-5.7.28-el7-x86_64.tar.gz

mv mysql-5.7.28-el7-x86_64 /usr/local/mysql

3.添加mysql用户&授权文件权限

useradd -s /sbin/nologin -M mysql

chown -R mysql:mysql /usr/local/mysql

4.编辑配置文件

vim /etc/my.cnf

[mysqld]

# GENERAL

datadir=/app/data

socket=/app/data/mysql.sock

user=mysql

default-storage-engine=InnoDB

[mysqld_safe]

log-error=/app/data/mysql-error.log

pid-file=/app/data/mysqld.pid

[client]

socket=/app/data/mysql.sock

5.初始化

cd /usr/local/mysql/bin

mkdir /app

./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/app/data

6.记住临时密码(在最后一行)

2020-06-04T03:05:04.010060Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2020-06-04T03:05:04.417360Z 0 [Warning] InnoDB: New log files created, LSN=45790

2020-06-04T03:05:04.487914Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2020-06-04T03:05:04.549839Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 3022d4be-a610-11ea-a416-000c29151353.

2020-06-04T03:05:04.551718Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2020-06-04T03:05:06.549468Z 0 [Warning] CA certificate ca.pem is self signed.

2020-06-04T03:05:07.057806Z 1 [Note] A temporary password is generated for root@localhost: UCivQQXqa8.j

7.开启ssl连接

./mysql_ssl_rsa_setup --datadir=/app/data

8.配置服务相关

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig --level 2345 mysqld on

ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

9.修改mysqld里的basedir和datadir

vim /etc/init.d/mysqld

basedir=/usr/local/mysql

datadir=/app/data

10.启动

systemctl start mysqld

systemctl daemon-reload

mysql -uroot -p

11.修改密码

alter user 'root'@'localhost' identified by 'Aa.bb9988';

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值