mysql57 centos7 使用

####### yum repository install #######
mysql yum repo http://repo.mysql.com/
wget http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
yum repolist all | grep mysql

####### mysql install #######
yum install mysql-community-server
systemctl start mysqld
systemctl enable mysqld

####### find password and login #######
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p

####### password update #######
alter user 'root'@'localhost' identified by '+P4ssword+';
or
set password for 'root'@'localhost'=password('+P4ssword+');

####### add user and grant privileges #######
create user 'myroot'@'%' identified by '+P4ssword+';
grant all privileges on *.* to 'myroot'@'%';
flush privileges;
or
grant select on *.* to 'myreader'@'%' identified by '+P4ssword+';
flush privileges;

####### my.cnf #######
[mysqld]
innodb_buffer_pool_size=512M

collation-server=utf8mb4_general_ci
init-connect='SET NAMES utf8mb4'
character-set-server=utf8mb4
skip-character-set-client-handshake
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

bind-address=0.0.0.0
max_connections=500

[client]
default-character-set=utf8mb4

[mysql]
default-character-set=utf8mb4

systemctl restart mysqld

 

test_db-master(https://codeload.github.com/datacharmer/test_db/zip/master

mysql -uroot -p -t < employees.sql

 

转载于:https://www.cnblogs.com/xiayudashan/p/9585773.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值