Change a Password for MySQL on Linux

Hình đại diện của thành viên
#1 23/02/2016 21:28
Change a Password for MySQL on Linux

Pre-Flight Check
- These instructions are intended for setting the password for all MySQL users named root on Linux via the command line. However, they can also be followed to change the password for any MySQL user.
- I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root.

First we’ll login to the MySQL server from the command line with the following command:

Mã:
mysql -u root -p


In this case, I’ve specified the user root with the -u flag, and then used the -p flag so MySQL prompts for a password. Enter your current password to complete the login.

Now switch to the appropriate MySQL database with the following command:

Mã:
use mysql;


Next we’ll update the password for all MySQL users with the name root. Be sure to replace your_new_password with the actual new password:

Mã:
update user set password=PASSWORD('your_new_password') where User='root';


Note: You can change the password for any user with the above command. Simply specify that user’s username in place of root.
Finally, reload the privileges:

Mã:
flush privileges;


Now you’re all set to exit MySQL!

Mã:
quit
(Cốc Cốc 53.2.137)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
------------
Những người đã like nghiammo1992 bởi bài viết có ích này:
Vuonghh1998
_______________
Diễn đàn chia sẻ kiến thức máy tính:
KETNOI123.COM

Ấn hiện ra để xem chữ ký của mình:

Hình đại diện của thành viên
#2 24/02/2016 06:10
vh đi a nghĩa
(Unknown)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
_______________
†™•—»Trảm Phong Bang«—•™†
︻︻︻¶▅▅▆▆▇▇◤
Hình đại diện của thành viên
#3 24/02/2016 12:35
Change a Password for MySQL on Linux

Pre-Flight Check
- These instructions are intended for setting the password for all MySQL users named root on Linux via the command line. However, they can also be followed to change the password for any MySQL user.
- I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root.

First we’ll login to the MySQL server from the command line with the following command:

Mã:
mysql -u root -p


In this case, I’ve specified the user root with the -u flag, and then used the -p flag so MySQL prompts for a password. Enter your current password to complete the login.

Now switch to the appropriate MySQL database with the following command:

Mã:
use mysql;


Next we’ll update the password for all MySQL users with the name root. Be sure to replace your_new_password with the actual new password:

Mã:
update user set password=PASSWORD('your_new_password') where User='root';


Note: You can change the password for any user with the above command. Simply specify that user’s username in place of root.
Finally, reload the privileges:

Mã:
flush privileges;


Now you’re all set to exit MySQL!

Mã:
quit
[/quote]
(Android)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
_______________
๖๑♥★☆۩ßα dαø☆★♥™
︻︻¶▅▆▇◤
________________
╭⌒╮
⌒╮╭⌒╮
╭⌒╮⌒⌒╮
╱◥███◣
|田|田田│
╱◥████◣╬
|田|田田田│╬
╬╬╬╬╬╬╬╬╬

________________
Ấn hiện ra để mình đoán tên bạn (khuyên ko nên ấn)

Hình đại diện của thành viên
#4 24/02/2016 13:07
@datbadao k đc trích dẫn bài viết của top nhé
(UC Browser 10.4.2.659)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
_______________
ஜ۩۞۩ஜTrảm Phong Bangஜ۩۞۩ஜ
ஜ۩۞۩ஜPhó Bang Chủஜ۩۞۩ஜ
ஜ۩۞۩ஜDajgiachandatஜ۩۞۩ஜ
░░░░░███████ ]▄▄▄▄▄▄▄▄
I▂▄▅█████████▅▄▃▂I
███████████████████]
.◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...
Wap mình nè
Trả lời nhanh

Chủ đề tương tự
Ai đang trực tuyến?