MySQL-安装mysql8
1. 安装配置
# 解压 tar -xf mysql-8.0.18-el7-x86_64.tar.gz -C /ups/app/mysql/ cd /ups/app/mysql/ mv mysql-8.0.18-el7-x86_64 mysql8 cd mysql8 mkdir -p {config,logs} mkdir -p /ups/data/mydata/mysql8 chown -R mysql:mysql . chown -R mysql:mysql /ups/data/mydata/mysql8 chmod 700 /ups/data/mydata/mysql8 cat> config/my.cnf <<-EOF [mysqld] basedir = /ups/app/mysql/mysql8 datadir = /ups/data/mydata/mysql8 log-error = /ups/app/mysql/mysql8/logs/mysql6033.err pid-file = /ups/app/mysql/mysql8/logs/mysql6033.pid socket = /ups/app/mysql/mysql8/logs/mysql6033.sock port = 6033 default-storage-engine = INNODB character-set-server = utf8mb4 collation-server = utf8mb4_general_ci # connect limits max_connect_errors = 5 max_connections = 1000 max_user_connections = 100 wait_timeout = 100 open_files_limit = 1024 # 限制将系统文件读到数据库(/etc/passwd) local-infile = 0 skip_name_resolve = ON server_id = 6033001 # error log、genera log timestamp log_timestamps=SYSTEM # 在关闭是将热数据dump到本地磁盘 innodb_buffer_pool_dump_at_shutdown = 1 # 在启动时将热数据加载到内存 innodb_buffer_pool_load_at_startup = 1 EOF # 初始化MySQL /ups/app/mysql/mysql8/bin/mysqld --defaults-file=/ups/app/mysql/mysql8/config/my.cnf --user=mysql --basedir=/ups/app/mysql/mysql8 --datadir=/ups/data/mydata/mysql8 --initialize # 启动服务 /ups/app/mysql/mysql8/bin/mysqld_safe --defaults-file=/ups/app/mysql/mysql8/config/my.cnf &
2. 配置账号
# mysql8 默认使用caching_sha2_password算法 # 修改root账号密码 ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘root‘; # 远程登录 create user ‘192.168.10.%‘ IDENTIFIED WITH mysql_native_password BY ‘root‘ ; grant all privileges on *.* to ‘root‘@‘192.168.10.%‘ with grant option; flush privileges; # 检查确认 select host,user, authentication_string, plugin from mysql.user;
相关推荐
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16