当前位置:网站首页>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;
边栏推荐
- Some important knowledge of MySQL
- 数据孤岛是企业数字化转型遇到的第一道险关
- ASP. Net kindergarten chain management system source code
- 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
- Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
- PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
- 831. KMP字符串
- 整型int的拼接和拆分
- el-upload上传组件的动态添加;el-upload动态上传文件;el-upload区分文件是哪个组件上传的。
- R language ggplot2 visualization: use the ggdensity function of ggpubr package to visualize the packet density graph, and use stat_ overlay_ normal_ The density function superimposes the positive dist
猜你喜欢

ASP. Net kindergarten chain management system source code

ASP. Net learning & ASP's one word

Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"

CSDN syntax description

Some important knowledge of MySQL

CIS芯片测试到底怎么测?

九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」

PMP practice once a day | don't get lost in the exam -7.7

Ways to improve the utilization of openeuler resources 01: Introduction

Cloud component development and upgrading
随机推荐
841. 字符串哈希
JVM GC garbage collection brief
sql 常用优化
Openeuler prize catching activities, to participate in?
JVM class loading mechanism
Throughput
Force buckle 643 Subarray maximum average I
SQL common optimization
Time tools
ASP. Net gymnasium integrated member management system source code, free sharing
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!!!
The DBSCAN function of FPC package of R language performs density clustering analysis on data, checks the clustering labels of all samples, and the table function calculates the two-dimensional contin
时间工具类
Sword finger offer II 013 Sum of two-dimensional submatrix
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
Is PMP beneficial to work? How to choose a reliable platform to make it easier to prepare for the exam!!!
机器学习笔记 - 使用Streamlit探索对象检测数据集
Some important knowledge of MySQL
[confluence] JVM memory adjustment