当前位置:网站首页>Mysql database password modification
Mysql database password modification
2022-06-13 00:49:00 【Python's path to becoming a God】
When using databases ,MySQL Need to change the password .
1. Use SET PASSWORD command
- Enter the command mysql -u root -p Appoint root The user login MySQL, After entering, press enter to enter the password . If the environment variable is not configured , Please be there. MySQL Of bin Login operation under directory .
- Use SET PASSWORD Change password command format to set password for username @localhost = password(newpwd);
, among username For the user name to change the password ,newpwd For the new password to be changed . As shown in the figure .
- Input quit; Command exit MySQL Log back in ;
2. Use mysqladmin Change Password
Use mysqladmin Command to change MySQL Of root The format of user password is mysqladmin -u user name -p Old password password New password .
Be careful : The following figure shows the command to change the password -uroot and -proot It's the whole , Don't write as -u root -p root,-u and root Space can be added between , But there will be warnings , So don't add spaces .
3. UPDATE Direct editing user surface
- Enter the command mysql -u root -p Appoint root The user login MySQL, After entering, press enter to enter the password . If the environment variable is not configured , Please be there. MySQL Of bin Login operation under directory .
- Input use mysql; Command to connect to the permission database .
- Enter the command update mysql.user set authentication_string=password(‘ New password ’) where user=‘ user name ’ and Host =‘localhost’; Set new password .
- Input flush privileges; Command refresh permission .
- Input quit; Command exit MySQL Log back in .

4. When the previous method reports an error, the following methods can be adopted:
- Enter the command mysql -u root -p Appoint root The user login MySQL, After entering, press enter to enter the password . If the environment variable is not configured , Please be there. MySQL Of bin Login operation under directory .
- Input use mysql;
- Enter the command alter user ‘root’@‘localhost’ IDENTIFIED BY ‘123456’;
- Input flush privileges; Command refresh permission .
- Input quit; Command exit MySQL Log back in .
边栏推荐
- Canvas game 2048 free map size
- (01). Net Maui actual construction project
- The seventh finals of the Blue Bridge Cup
- 人神共愤,唐山“群殴女性事件”细节...
- Penetration test summary
- What is meebits? A brief explanation
- Three column simple Typecho theme lanstar/ Blue Star Typecho theme
- [JS component] custom paging
- A simple deadlock example
- 蓝桥杯单片机第七届决赛
猜你喜欢

Cve-2021-24078 vulnerability analysis
![[JS] battle chess](/img/1f/83ca6bcb000a5567dc6d3b72463ff8.jpg)
[JS] battle chess

How many rounds of deep learning training? How many iterations?

The scope builder coroutinescope, runblocking and supervisorscope of kotlin collaboration processes run synchronously. How can other collaboration processes not be suspended when the collaboration pro

Triangle wave and triangle wave convolution

JPA execution failed in scheduled task -executing an update/delete query transactionrequiredexception

Can GPU acceleration pytorch work?

gpu加速pytorch能用吗?

1. Google grpc framework source code analysis Hello World

Daily buckle exercise - conclusion
随机推荐
[imx6ull] video monitoring project (USB camera +ffmepeg)
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
硬(磁)盘(一)
The seventh finals of the Blue Bridge Cup
Oceanbase is the leader in the magic quadrant of China's database in 2021
Four startup modes of kotlin collaboration
ImportError: cannot import name ' get_ ora_ doc' from partially initialized module
Bubble sort - alternate sort at both ends
深度学习训练多少轮?迭代多少次?
Andersen global expands its business in northern Europe through cooperation agreements in Finland and Denmark
阿姨学代码续集:能力吊打大批程序员
Card constructions -- two points
With a market value of more than trillion yuan and a sales volume of more than 100000 yuan for three consecutive months, will BYD become the strongest domestic brand?
【北亚服务器数据恢复】虚拟机文件丢失导致Hyper-V服务瘫痪的数据恢复案例
Lambda expression
Basic operations of FreeMarker
Arduino control tm1637 common positive four digit nixie tube
为什么磁盘分区的时候,第一个分区前面总有一段空间(63或者2048个扇区)
杂记:intel11代和12代移动版支持原生Thunderbolt4接口,桌面版不支持
MCU serial port interrupt and message receiving and sending processing -- judge and control the received information