惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
U
Unit 42
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
腾讯CDC
I
InfoQ
GbyAI
GbyAI
博客园_首页

lvbibir's Blog

shell | 磁盘空间分析脚本 Linux cat 和 tee 命令写入文件 python | 使用 uv 管理你的 python 环境 Claude Code 完整配置指南 windows | mihomo 内核独立部署指南 linux | 磁盘扩容 wsl | 释放长久运行占用的磁盘空间 mysql | 线程上限问题处理 麒麟 7.6 安装谷歌 OTP 认证模块 suse 12sp5 升级 openssh 及 openssl 《谁的青春不迷茫》 docker | centos7 部署 docker vim | 基础配置和使用 windows | rime 输入法 & 雾凇方案 shell | sshpass 批量传输文件及执行命令 wsl | 原生 linux 方式安装 docker nodejs | fnm + pnpm 开发环境配置 wsl | 安装配置 miniconda 虚拟环境 wsl | 自动更新系统代理 wsl | bashrc 环境变量不正确加载的处理方法 wsl | win10 安装 wsl2 troubleshooting | ssh 成功但是 scp 失败 linux | 常用命令总结 docker 部署 piclist shell | 检测网站存活并自动钉钉告警 Zabbix | 监控端口连通性并自动追踪 TCP 路由 windows | 自定义开机快速启动项 windows | miniconda 配置 python 虚拟环境 Zabbix | 监控主机到指定 ip 的流量大小 shell | centos 初始化
suse 12sp5 部署 mysql 5.7
lvbibir · 2024-05-15 · via lvbibir's Blog

0 前言

系统使用 Gnome 环境

1 安装

安装依赖

zypper in libatomic1
zypper in perl-JSON

下载 mysql 安装包, 链接

tar xf mysql-5.7.44-1.sles12.x86_64.rpm-bundle.tar
rpm -ivh mysql-community-common-5.7.44-1.sles12.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.44-1.sles12.x86_64.rpm
rpm -ivh mysql-community-client-5.7.44-1.sles12.x86_64.rpm
rpm -ivh mysql-community-server-5.7.44-1.sles12.x86_64.rpm
mkdir -p /data/mysql/{data,tmp}
chown -R mysql /data/mysql
mysqld --initialize --datadir=/data/mysql/data/ --user=mysql

修改 /etc/my.cnf 配置文件

[client]
port = 3306
socket = /data/mysql/mysql.sock
default-character-set=utf8

[mysqld]
port = 3306
skip-grant-tables
datadir = /data/mysql/data
tmpdir = /data/mysql/tmp
socket = /data/mysql/mysql.sock
character-set-server = utf8
collation-server = utf8_general_ci
pid-file = /data/mysql/mysql.pid
user = mysql
explicit_defaults_for_timestamp
lower_case_table_names = 1
max_connections = 1000
back_log = 1024
open_files_limit = 10240
table_open_cache = 5120
skip-external-locking
local-infile = 1
key_buffer_size = 32M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M


log-bin = /data/mysql/mysql-bin
binlog_format = mixed
server-id = 1

innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 256M
innodb_buffer_pool_instances = 2
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_purge_threads = 1

slow_query_log = 1
long_query_time = 10
log-queries-not-using-indexes

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

expire-logs-days = 10

[mysqldump]
quick
max_allowed_packet = 512M
net_buffer_length = 16384

[mysql]
auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

2 配置

首次启动并修改密码

systemctl start mysql
mysql -uroot -p 

use mysql;
update user set authentication_string = password('D`N~Wv`%=XJeX'), password_expired = 'N', password_last_changed = now() where user = 'root';

修改完密码后注释掉 /etc/my.cnf 中的 skip-grant-tables 并重启 mysql

设置远程访问

mysql -uroot -p

use mysql;
grant all PRIVILEGES on *.* to root@'%' identified by 'D`N~Wv`%=XJeX';
flush privileges;

以上.

wechat_pay

微信

alipay

支付宝