Bang hộiTiền mặt: 0 Xu Trò chơiHộp quà giáng sinhThứ Sáu, 17:57:51 - 19/04/2024
Chia sẻ kiến thức sử dụng VPS (máy chủ ảo) - Server (máy chủ riêng)

Các điều hành viên: Mod, SMod, Admin

Change a Password for MySQL on Linux

Change a Password for MySQL on Linux

#1 » Gửi bài gửi bởi nghiatichxanh1992 » 23/02/2016 21:28 » @435059

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ã: Chọn tất cả
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ã: Chọn tất cả
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ã: Chọn tất cả
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ã: Chọn tất cả
flush privileges;


Now you’re all set to exit MySQL!

Mã: Chọn tất cả
quit

Những người đã like nghiatichxanh1992 bởi bài viết có ích này:
Vuonghh1998
Rating: 0.14%
 
nghiatichxanh1992 ✅
Hình đại diện của thành viên
Rank: ☀️2/30☀️
Cấp độ:
Tu luyện:
Like:
Online:
Bang hội: Tiếu Ngạo
Xếp hạng Bang hội: ⚡5/60⚡
Level:
Chủ đề đã tạo: 🩸4142/4142🩸
Tiền mặt:
Ngân hàng:
Nhóm:
Danh hiệu: ⚝Truyền Thuyết⚝
Giới tính:
Ngày tham gia:
Đến từ:
Thiết bị:
Số điện thoại:
(Cốc Cốc 53.2.137)

Re: Change a Password for MySQL on Linux

#2 » Gửi bài gửi bởi ngadoan0602 » 24/02/2016 06:10 » @435082

vh đi a nghĩa
†™•—»Trảm Phong Bang«—•™†
︻︻︻¶▅▅▆▆▇▇◤
ngadoan0602
Hình đại diện của thành viên
Rank: ☀️10/30☀️
Cấp độ:
Tu luyện:
Like:
Online:
Bang hội: Trảm Phong
Xếp hạng Bang hội: ⚡1/60⚡
Level:
Chủ đề đã tạo: 🩸22/4142🩸
Tiền mặt:
Ngân hàng:
Nhóm:
Danh hiệu: ⚝Vô Ảnh Cước⚝
Giới tính:
Ngày tham gia:
Đến từ:
Số điện thoại:
(Unknown)

Re: Change a Password for MySQL on Linux

#3 » Gửi bài gửi bởi Datbadao » 24/02/2016 12:35 » @435119

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ã: Chọn tất cả
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ã: Chọn tất cả
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ã: Chọn tất cả
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ã: Chọn tất cả
flush privileges;


Now you’re all set to exit MySQL!

Mã: Chọn tất cả
quit
[/quote]
๖๑♥★☆۩ßα dαø☆★♥™
︻︻¶▅▆▇◤
________________
╭⌒╮
⌒╮╭⌒╮
╭⌒╮⌒⌒╮
╱◥███◣
|田|田田│
╱◥████◣╬
|田|田田田│╬
╬╬╬╬╬╬╬╬╬

________________
Ấn hiện ra để mình đoán tên bạn (khuyên ko nên ấn)
Datbadao
Hình đại diện của thành viên
Rank: ☀️2/30☀️
Cấp độ:
Tu luyện:
Like:
Online:
Bang hội: ?????
Xếp hạng Bang hội: ⚡??/60⚡
Level:
Chủ đề đã tạo: 🩸???/4142🩸
Tiền mặt:
Nhóm:
Danh hiệu: ?????
Giới tính:
Ngày tham gia:
Đến từ:
Số điện thoại:
(Android)

Re: Change a Password for MySQL on Linux

#4 » Gửi bài gửi bởi Dajgiachandat » 24/02/2016 13:07 » @435120

@datbadao k đc trích dẫn bài viết của top nhé
ஜ۩۞۩ஜTrảm Phong Bangஜ۩۞۩ஜ
ஜ۩۞۩ஜPhó Bang Chủஜ۩۞۩ஜ
ஜ۩۞۩ஜDajgiachandatஜ۩۞۩ஜ
░░░░░███████ ]▄▄▄▄▄▄▄▄
I▂▄▅█████████▅▄▃▂I
███████████████████]
.◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...
Wap mình nè
Dajgiachandat ✅
Hình đại diện của thành viên
Rank: ☀️22/30☀️
Cấp độ:
Tu luyện:
Like:
Online:
Bang hội: Trảm Phong
Xếp hạng Bang hội: ⚡1/60⚡
Level:
Chủ đề đã tạo: 🩸106/4142🩸
Tiền mặt:
Nhóm:
Danh hiệu: ⚝Hiệp Khách Cuối Cùng Trên Giang Hồ⚝
Giới tính:
Ngày tham gia:
Đến từ:
Số điện thoại:
(UC Browser 10.4.2.659)



Quay về VPS - Server

 


  • Chủ đề tương tự
    Trả lời
    Xem
    Bài viết mới nhất