当前位置:网站首页>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 .
边栏推荐
- [JS component] previous queue prompt
- [JS] battle chess
- [JS component] browse progress bar
- The seventh finals of the Blue Bridge Cup
- Hard (magnetic) disk (I)
- ImportError: cannot import name ' get_ ora_ doc' from partially initialized module
- What is meebits? A brief explanation
- [JS component] create a custom horizontal and vertical scroll bar following the steam style
- Arduino uses esp8266+ lighting technology + Xiaoai audio to realize voice control switch
- Card constructions -- two points
猜你喜欢

Kali system -- fierce of DNS collection and analysis

Static analysis of malicious code

AOF持久化

Hard (magnetic) disk (II)
![[JS component] simulation framework](/img/f2/8d5bb7e0db55a87ce76c09fae03694.jpg)
[JS component] simulation framework

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?

antdPro - ProTable 实现两个选择框联动效果

Influence of higher order poles on waveform

Comparison of disk partition modes (MBR and GPT)

通过抓包下载钉钉直播回放
随机推荐
深度学习训练多少轮?迭代多少次?
Today's sleep quality record 74 points
Biological unlocking - Fingerprint entry process
从ADK的WinPE自己手动构建自己的PE
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
Assembly language learning
高阶极点对于波形的影响
People and gods are angry. Details of Tangshan "mass beating of women incident"
[JS component] calendar
Androi天氣
How to determine whether T is a value type in a generic type or a reference class- How to determine whether T is a value type or reference class in generic?
Map from getting started to performance optimization
单片机串口中断以及消息收发处理——对接受信息进行判断实现控制
深度学习每周期的步数多少合适?
What is the difference between pytorch and tensorflow?
【服务器数据恢复】存储服务器之间迁移数据时数据丢失恢复成功案例
(01).NET MAUI实战 建项目
ImportError: cannot import name ' get_ ora_ doc' from partially initialized module
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
Programming training 1