当前位置:网站首页>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;
边栏推荐
- RESTAPI 版本控制策略【eolink 翻译】
- 编译器优化那些事儿(4):归纳变量
- 干货分享|DevExpress v22.1原版帮助文档下载集合
- 毕业季|遗憾而又幸运的毕业季
- Data island is the first danger encountered by enterprises in their digital transformation
- Flink并行度和Slot详解
- c语言如何判定是32位系统还是64位系统
- torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
- Interpretation of transpose convolution theory (input-output size analysis)
- Version selection of boot and cloud
猜你喜欢

Yolov6:yolov6+win10--- train your own dataset

Ways to improve the utilization of openeuler resources 01: Introduction

ASP.NET学习& asp‘s one word

Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记

ASP. Net learning & ASP's one word

Data island is the first danger encountered by enterprises in their digital transformation

Interpretation of transpose convolution theory (input-output size analysis)

多个线程之间如何协同

CSDN语法说明

干货分享|DevExpress v22.1原版帮助文档下载集合
随机推荐
【哲思与实战】程序设计之道
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
Force buckle 2319 Judge whether the matrix is an X matrix
Force buckle 989 Integer addition in array form
一文读懂数仓中的pg_stat
Boot 和 Cloud 的版本选型
使用高斯Redis实现二级索引
Data island is the first danger encountered by enterprises in their digital transformation
841. 字符串哈希
Force buckle 599 Minimum index sum of two lists
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
力扣 459. 重复的子字符串
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
力扣 1232.缀点成线
如何在软件研发阶段落地安全实践
Cloud 组件发展升级
Force buckle 2315 Statistical asterisk
CIS芯片测试到底怎么测?
最多可以参加的会议数目[贪心 + 优先队列]
Visual Studio 插件之CodeMaid自动整理代码