当前位置:网站首页>kubernetes之创建mysql8
kubernetes之创建mysql8
2022-07-07 18:05:00 【李炜伦】
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql1
namespace: default
labels:
app: mysql1
spec:
replicas: 1
selector:
matchLabels:
app: mysql1
template:
metadata:
labels:
app: mysql1
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: ip
operator: In
values:
- 172.16.12.104
containers:
- name: mysql1
envFrom:
- secretRef:
name: mysql1
image: mysql:8
args:
- "--lower_case_table_names=1"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3306
name: 3306tcp
protocol: TCP
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql1data
volumes:
- hostPath:
path: /opt/mysql1/data/
type: DirectoryOrCreate
name: mysql1data
restartPolicy: Always
mysql8有个重要的特性,大小写敏感只能在数据库初始化的时候完成,所以我们要在args加入–lower_case_table_names=1,即大小写不敏感
创建用户,mysql8需要先创建用户才能分配权限
use mysql;create user 'szxy_test'@'%' identified by 'Liweilun1208.';
如果创建用户时忘记with mysql_native_password
用该用户登录会报authentication plugin 'caching_sha2_password' cannot be loaded;
alter user 'szxy_test'@'%' identified with mysql_native_password by 'Liweilun1208.';
分配权限
grant all privileges on *.* to 'szxy_test'@'%' with grant option;
边栏推荐
- Yolov6:yolov6+win10--- train your own dataset
- 831. KMP string
- 模拟实现string类
- Cloud 组件发展升级
- JVM GC垃圾回收简述
- JVM class loading mechanism
- 9 atomic operation class 18 Rohan enhancement
- openEuler 资源利用率提升之道 01:概论
- Automatic classification of defective photovoltaic module cells in electroluminescence images-論文閱讀筆記
- Version selection of boot and cloud
猜你喜欢
Cloud component development and upgrading
vulnhub之school 1
开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
力扣 599. 两个列表的最小索引总和
ASP. Net kindergarten chain management system source code
Implement secondary index with Gaussian redis
Compiler optimization (4): inductive variables
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
随机推荐
Force buckle 599 Minimum index sum of two lists
Redis——基本使用(key、String、List、Set 、Zset 、Hash、Geo、Bitmap、Hyperloglog、事务 )
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
Chapter 20 using work queue manager (3)
JVM GC garbage collection brief
equals 方法
Force buckle 989 Integer addition in array form
TS快速入门-泛型
力扣 2319. 判断矩阵是否是一个 X 矩阵
毕业季|遗憾而又幸运的毕业季
Cloud component development and upgrading
841. String hash
Cloud 组件发展升级
831. KMP string
pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
SQL common optimization
干货分享|DevExpress v22.1原版帮助文档下载集合
PMP practice once a day | don't get lost in the exam -7.7
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
Force buckle 1232 Dotted line