Bạn là chuyên gia trong lĩnh vực bạn đam mê! Đăng ký ngay, biến kiến thức của bạn thành sức mạnh lan tỏa cộng đồng!
edited by
72,947 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.

Netdepviet Wiki là nơi để bạn hỏi đáp, chia sẻ kiến thức và khám phá mọi khía cạnh của cuộc sống. Xem thêm phần trợ giúp để biết chi tiết. Hiện tại, Wiki chỉ hỗ trợ người dùng đăng nhập bằng tài khoản Gmail.

133 questions

120 answers

4 comments

69 users

Related questions

0 answers
0 votes
0 votes
13.1k views
2 answers
1 vote
1 vote
5.1k views
0 answers
0 votes
0 votes
406 views
0 answers
0 votes
0 votes
377 views
0 answers
–1 vote
–1 vote
506 views
Since © 2006 Netdepviet.org All rights reserved. Forum | Privacy Policy | Pictures