当前位置:网站首页>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;
边栏推荐
- CSDN syntax description
- R language uses ggplot2 function to visualize the histogram distribution of counting target variables that need to build Poisson regression model, and analyzes the feasibility of building Poisson regr
- 力扣 1037.有效的回旋镖
- Graduation season | regretful and lucky graduation season
- vulnhub之Funfox2
- Force buckle 599 Minimum index sum of two lists
- 一锅乱炖,npm、yarn cnpm常用命令合集
- Force buckle 88 Merge two ordered arrays
- Make this crmeb single merchant wechat mall system popular, so easy to use!
- Simulate the implementation of string class
猜你喜欢

开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!

Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!

机器学习笔记 - 使用Streamlit探索对象检测数据集

Sword finger offer II 013 Sum of two-dimensional submatrix

数据孤岛是企业数字化转型遇到的第一道险关

The boundary of Bi: what is bi not suitable for? Master data, Martech? How to expand?

华南X99平台打鸡血教程

9 atomic operation class 18 Rohan enhancement

mock. JS returns an array from the optional data in the object array

mysql 的一些重要知识
随机推荐
Force buckle 1037 Effective boomerang
力扣 459. 重复的子字符串
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
R language dplyr package mutate_ At function and min_ The rank function calculates the sorting sequence number value and ranking value of the specified data column in the dataframe, and assigns the ra
【哲思与实战】程序设计之道
MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
8 CAS
Chapter 20 using work queue manager (3)
gorilla官方:golang开websocket client的示例代码
Detailed explanation of Flink parallelism and slot
Semantic SLAM源码解析
JVM GC garbage collection brief
el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
R language ggplot2 visualization: use the ggviolin function of ggpubr package to visualize the violin diagram, set the palette parameter to customize the filling color of violin diagrams at different
力扣 912.排序数组
Training IX basic configuration of network services
Graduation season | regretful and lucky graduation season
第二十章 使用工作队列管理器(三)
vulnhub之tre1