当前位置:网站首页>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]
边栏推荐
- Hausdorff loss function for semantic segmentation
- The latest generation of Internet: Web 3.0
- 半透明双层玻璃侧厚
- 6-9漏洞利用-Telnet登陆提权
- xgen 毛发guide历史被清理解决方法
- 46. IO model
- 2022 Guangdong Provincial Safety Officer a certificate, the third batch (main person in charge) exercise questions and mock examination
- Build an embedded development environment
- Difference and connection between structure and Consortium
- Linear regression + basic optimization of deep learning
猜你喜欢

BCG 使用之CBCGPEdit控件

【手写数字识别】基于Lenet网络实现手写数字识别附matlab代码

石墨厚度测量

cut,sort,uniq,xargs

Idea debug according to conditional breakpoints

ES6 learning function (strict mode, higher-order function, closure)

SQL优化

Xgen hair guide history cleared solution

Scratch reverse order output electronic society graphical programming scratch grade examination level 4 true questions and answers analysis June 2022

matlab导入小数点后9位以上的浮点数
随机推荐
New data type of redis bitmaps
JS learning notes 09-12: prototype objects, foreach+tostring and recycle bin
6-9漏洞利用-Telnet登陆提权
【手写数字识别】基于Lenet网络实现手写数字识别附matlab代码
JS学习笔记06-08:数组的遍历以及数组的四个方法
MySQL data type
Yyds dry inventory cross origin cross domain request
【LeetCode】通用操作总结
朋友圈如何定位?3个核心步骤,打造卖爆产品的朋友圈
Introduction to flutter flutter calculates the last 1 month, 3 months, half a year, 12 months
The latest generation of Internet: Web 3.0
JS learning notes 01-03 - Reference of this, global scope, method
Microservices and microservice architecture
46. IO model
2022 Guangdong Provincial Safety Officer a certificate, the third batch (main person in charge) exercise questions and mock examination
Picture browser
JS study note 04-05 - modification of constructor and creation using factory method
项目代码训练教程
6-9 vulnerability exploitation telnet login rights lifting
RPA相关知识点整理