Domains and subscriptions list is empty – [SỬA LỖI]

Tác giả: 26/08/2022

Nguyên nhân

Cơ sở dữ liệu không thống nhất. Ít nhất một tên miền trong Plesk được gán cho một khách hàng không tồn tại.

Giải pháp

Để khắc phục sự không thống nhất, tên miền sẽ được chỉ định cho một khách hàng hiện có. Ví dụ này cho thấy cách gán nó cho admin.

Tạo bản sao lưu của cơ sở dữ liệu Plesk.

Truy cập cơ sở dữ liệu MySQL
Xác định ID và tên miền được gán cho khách hàng không tồn tại.

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">mysql> SELECT <a class="external-link" href="http://d.id/" rel="nofollow">d.id</a>, d.cl_id, <a class="external-link" href="http://d.name/" rel="nofollow">d.name</a> FROM domains d LEFT JOIN clients c ON d.cl_id = <a class="external-link" href="http://c.id/" rel="nofollow">c.id</a> WHERE <a class="external-link" href="http://c.id/" rel="nofollow">c.id</a> IS NULL;</span>

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+-------+----------+</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">| id | cl_id | name |</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+-------+----------+</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">| 4 | 0 | sub4.tld |</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">| 5 | 0 | sub5.tld |</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+-------+----------+</span>

Lưu ý rằng nếu có cl_id khác được hiển thị trong đầu ra ở trên (không bằng 0), thì client bị thiếu trong bảng clients. Ví dụ, nếu cl_id = 7 được hiển thị, thì client với id = 7 bị thiếu trong bảng clients.

Xác định ID của người dùng. Trong trường hợp này, ID là 1

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">mysql> SELECT id FROM clients WHERE type='admin';</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">| id |</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">| 1 |</span>
<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">+----+</span>

Để khắc phục một miền, gán nó cho người dùng được chỉ định (trong trường hợp này là “quản trị”), với một ID cụ thể (trong trường hợp này là 4), hãy sử dụng các lệnh sau:

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">mysql> UPDATE domains SET cl_id =1 WHERE id=4;</span>

Để khắc phục Domains and subscriptions list is empty, tất cả các miền có khách hàng không tồn tại, hãy sử dụng các hướng dẫn sau:

6.1. Đặt ID của các tên miền vào một tệp:

For Linux

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;"># MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin -Dpsa -Ne"SELECT <a class="external-link" href="http://d.id/" rel="nofollow">d.id</a> FROM domains d LEFT JOIN clients c ON d.cl_id = <a class="external-link" href="http://c.id/" rel="nofollow">c.id</a> WHERE <a class="external-link" href="http://c.id/" rel="nofollow">c.id</a> IS NULL;" > ./domains_ids</span>

For Windows

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">%plesk_dir%\\MySQL\\bin>mysql.exe -P8306 -uadmin -p<admin_password> psa -Ne "SELECT <a class="external-link" href="http://d.id/" rel="nofollow">d.id</a> FROM domains d LEFT JOIN clients c ON d.cl_id = <a class="external-link" href="http://c.id/" rel="nofollow">c.id</a>;" > ./domains_ids</span>

6.2. Xác minh rằng ID của các tên miền giống như trong đoạn 2:

For Linux

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;"># cat ./domains_ids</span>
4
5

For Windows

Mở %plesk_dir%\\MySQL\\bin\\domains_ids  bằng notepad.

6.3. Chỉ định các miền đó cho admin bằng lệnh sau:

For Linux

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">#cat domains_ids|while read i;do echo ==changing domain with id $i==;domain_id=$i; MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin -Dpsa -e"UPDATE domains SET cl_id =$admin_id WHERE id=$domain_id";done</span>
==changing domain with id 4==
==changing domain with id 5==

For Windows – Domains and subscriptions list is empty

<span style="font-family: 'times new roman', times, serif; font-size: 14pt;">%plesk_dir%\\MySQL\\bin>for /F %i IN (domains_ids) do @mysql.exe -P8306 -uadmin -p<admin_password> psa -Ne "UPDATE domains SET cl_id =4 WHERE id=%i;"</span>

Khi cần hỗ trợ xin liên hệ với chúng tôi:

—————————————–

Công ty phần mềm Nhân Hòa

Trụ sở Hà Nội: Tầng 4 – Toà nhà 97 – 99 Láng Hạ, Đống Đa, Hà Nội

Chi nhánh HCM: 270 Cao Thắng (nối dài), Phường 12, Quận 10, TP HCM

Chi nhánh Vinh – Nghệ An: Tầng 2 Tòa nhà Sài Gòn Sky, ngõ 26 Nguyễn Thái Học, phường Đội Cung, TP. Vinh, Nghệ An Hotline: 19006680

Để lại một bình luận