Mỗi người đều là chuyên gia trong lịnh vực bạn đam mê ! Đăng ký và cùng chia sẻ kiến thức nào
edited by
68,908 views
0 votes
0 votes

 Trường hợp admin của question2answer, quên mật khẩu, muốn thay đổi trực tiếp trong cơ sở dữ liệu, có thể thực hiện theo các cách sau:

1. Với phiên bản Q2A từ 1.7.4 trở về trước:

 Thực hiện truy vấn cập nhật mật khẩu mới :

UPDATE qa_users SET passcheck = UNHEX(SHA1(CONCAT(LEFT(passsalt, 8), 'new_pass', RIGHT(passsalt, 8)))) WHERE userid = 1;

2. Với các phiên bản từ sau 1.8:

 Tạo hash password trước bằng lệnh:

echo password_hash('new_pass', 1);

kết quả trả về là dãy loằng ngoằng ví dụ:

$2y$10$xkK9WkpgacLrE4kakOZFmO/1SxLWq6BvJYSjAC1GAZnKShSQbjm.O

 Rồi mới cập nhật cơ sở dữ liệu:

UPDATE qa_users SET passhash = '$2y$10$xkK9WkpgacLrE4kakOZFmO/1SxLWq6BvJYSjAC1GAZnKShSQbjm.O' WHERE userid = 1;


edited by
User Avatar
by Editor
5.6k points

Please log in or register to answer this question.

Sponsors


Vietbeauty Community
Netdepviet Wiki là nơi hỏi-đáp, chia sẻ kiến thức và mọi mặt cuộc sống.
Xem thêm trợ giúp. Hiện tại chỉ mở Wiki cho người dùng có tài khoản Facebook và Gmail đăng nhập

131 questions

119 answers

4 comments

68 users

ADVERTISEMENT

Related questions

0 answers
0 votes
0 votes
12.3k views
2 answers
1 vote
1 vote
4.8k views
0 answers
0 votes
0 votes
75 views
0 answers
0 votes
0 votes
53 views
0 answers
–1 vote
–1 vote
199 views
Since © 2006 Netdepviet.org All rights reserved. Home | Privacy Policy | Pictures