当前位置:网站首页>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;
边栏推荐
- 如何在软件研发阶段落地安全实践
- 使用高斯Redis实现二级索引
- pom.xml 配置文件标签作用简述
- MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
- JVM GC垃圾回收简述
- 华南X99平台打鸡血教程
- Force buckle 989 Integer addition in array form
- R language ggplot2 visualization: use the ggqqplot function of ggpubr package to visualize the QQ graph (Quantitative quantitative plot)
- Is PMP beneficial to work? How to choose a reliable platform to make it easier to prepare for the exam!!!
- mock.js从对象数组中任选数据返回一个数组
猜你喜欢
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
CSDN syntax description
整型int的拼接和拆分
Yolov6:yolov6+win10--- train your own dataset
Welcome to the markdown editor
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
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!!!
CIS芯片测试到底怎么测?
论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
随机推荐
Yolov6:yolov6+win10--- train your own dataset
【STL】vector
sql 常用优化
Force buckle 1037 Effective boomerang
力扣 599. 两个列表的最小索引总和
线性基
8 CAS
CUDA versions are inconsistent, and errors are reported when compiling apex
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
Data island is the first danger encountered by enterprises in their digital transformation
831. KMP字符串
R language dplyr package select function, group_ The by function, filter function and do function obtain the third largest value of a specific numerical data column in a specified level in a specified
Force buckle 599 Minimum index sum of two lists
Simulate the implementation of string class
openEuler 有奖捉虫活动,来参与一下?
Force buckle 643 Subarray maximum average I
CSDN语法说明
831. KMP string
机器学习笔记 - 使用Streamlit探索对象检测数据集
使用高斯Redis实现二级索引