当前位置:网站首页>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 .
边栏推荐
- Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
- [imx6ull] video monitoring project (USB camera +ffmepeg)
- 深度学习每周期的步数多少合适?
- What is the difference between pytorch and tensorflow?
- Target recognition gadget
- Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
- Cards are unpredictable
- 【服务器数据恢复】存储服务器之间迁移数据时数据丢失恢复成功案例
- gpu加速pytorch能用吗?
- Canvas game lower level 100
猜你喜欢

Using fastjson to solve the problem of returning an empty array from a null value of a field string object

Kotlin coroutine withcontext switch thread

People and gods are angry. Details of Tangshan "mass beating of women incident"

Daily buckle exercise - conclusion

MySQL lpad() and rpad() concatenate string functions with specified length

深度学习模型剪枝
![[JS component] customize the right-click menu](/img/a3/4555619db17e4c398e72c7d6b12f5d.jpg)
[JS component] customize the right-click menu

Summary of openstack installation problems

磁盘分区方式对比(MBR与GPT)

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?
随机推荐
Bubble sort - alternate sort at both ends
Aof persistence
Arduino interrupt
In / out / inout details of MySQL stored procedures
kotlin 协程withContext切换线程
Androi weather
Target recognition gadget
Deep learning model pruning
Win10 home vs pro vs enterprise vs enterprise LTSC
Kotlin 协程,job的生命周期
[JS component] customize the right-click menu
Easyexcel read excel simple demo
Build your own PE manually from winpe of ADK
高阶极点对于波形的影响
磁盘分区方式对比(MBR与GPT)
Composite key relationships using Sqlalchemy - relationships on composite keys using Sqlalchemy
[buglist] serial port programming does not read data
人神共愤,唐山“群殴女性事件”细节...
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?
Learning and Development notes of mongdb