当前位置:网站首页>mysql 初始化修改密码问题
mysql 初始化修改密码问题
2022-07-17 08:33:00 【Direct_】
文章目录
mysql 初始化修改密码问题
在使用二进制安装完成 MySQL 之后(这里二进制安装时是执行的没有设置初始密码的),安装详情可参考:https://blog.csdn.net/D1179869625/article/details/125213724
1. 使用 mysql_secure_installation 脚本初始化
使用如下脚本初始化 mysql 。使用 mysql_secure_installation 脚本初始化。但是这里为什么在设置密码的时候还是需要交互。没搞明白。
#!/bin/bash
mysql_secure_installation <<EOF y 0 [email protected] [email protected] y y y y y EOF
2. 使用命令行修改密码
这里使用命令行修改密码,但是在没有密码的情况下如何执行成功?
mysql -u root -pPWSSWORD --connect-expired-password -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$Abcd@1234';"
3. 使用 mysqladmin 命令修改密码
使用 mysqladmin 不用加 -p 参数修改成功
# 语法
mysqladmin -u用户名 -p旧密码 password 新密码
# 示例:(写在脚本里也可以执行成功)
mysqladmin -uroot password [email protected]
边栏推荐
- 力扣912排序数组笔记
- Redis overview installation
- Introduction to flutter flutter calculates the last 1 month, 3 months, half a year, 12 months
- Megatexture technology of ID tech5
- WebGL的CPU负载问题-WebGL对比
- Expanding hard disk in VMWare
- TP5微信提现 商家转账到零钱(复制皆可用)
- JS learning notes 09-12: prototype objects, foreach+tostring and recycle bin
- 什么是内存溢出
- LeetCode 0116. Populate the next right node pointer for each node
猜你喜欢

STM32CUBEIDE(9)----USART通过DMA收发

Idea debug according to conditional breakpoints

【人脸识别】基于直方图Histogram实现人脸识别附matlab代码

Expanding hard disk in VMWare

Finishing of key concepts on deep neural networks exercises in the fourth week of in-depth learning

一文,教你实现单点登录

2022广东省安全员A证第三批(主要负责人)练习题及模拟考试

Redis common data types - redis list and redis set

Graphite thickness measurement

2022 Guangdong Provincial Safety Officer a certificate, the third batch (main person in charge) exercise questions and mock examination
随机推荐
一文,教你实现单点登录
石墨厚度测量
Nacos new configuration management
oop_ Reference type variable transfer value
图片浏览器
2022 Shanghai safety officer C certificate national question bank and answers
深度学习之线性回归+基础优化
什么是内存溢出
BCG 使用之CBCGPEdit控件
力扣1669合並兩個鏈錶筆記
How to write a string field in MySQL if its value is not empty?
RestTemplate
49. MySQL usage
pygame中display模块
Baidu Apollo
搭建嵌入式开发环境
项目代码训练教程
凸面镜面3D玻璃轮廓扫描
不创建临时变量交换数组元素
分布式事务-可靠消息最终一致性解决方案