Archive for the tag 'column'

mysqlshow - display database, table, and column information

SYNOPSIS

mysqlshow [options] [db_name [tbl_name [col_name]]]

DESCRIPTION
The mysqlshow client can be used to quickly see which databases exist, their tables, or a tableĀ“s columns or indexes.

mysqlshow provides a command-line interface to several SQL SHOW statements.
The same information can be obtained by using those statements directly.

For example, you can issue them from the mysql client program.

Invoke mysqlshow like this:

shell> mysqlshow [options] [db_name [tbl_name [col_name]]]

If no database is given, a list of database names is shown.
If no table is given, all matching tables in the database are shown.

DB query failed: Unknown column ’serial’ in ‘field list’

After upgrading plesk from version 8.4 to 8.6, you may encounter the following error while deactivating a domain.

Plesk >> Domains >> domain.com

Error:

DB query failed: Unknown column ’serial’ in ‘field list’
———————- Debug Info ——————————-
0: plib\common_func.php3:243
db_query(string ’select `id`, `name`, `displayName`, `email`, `status`, `type`, `ttl`, `ttl_unit`, `refresh`, `refresh_unit`, `retry`, `retry_unit`, `expire`, `expire_unit`, `minimum`, `minimum_unit`, `serial`, `serial_format` from `dns_zone` where `id`=311′)
1: plib\class.Table.php:189
Table->select()
2: plib\dns\DNSZone.php:49
DNSZone->DNSZone(string ‘311′)
3: plib\common_func.php3:2929
objectMaker(string ‘DNSZone’, string ‘311′)
4: plib\dns\DNSManager.php:34
DNSManager::getDNSZone(string ‘311′)
5: plib\class.Domain.php:787
Domain->getDNSZone()
6: plib\class.Domain.php:244
Domain->turnOff(integer ‘16′, integer ‘0′, boolean false)
7: plib\class.BsDomain.php:417
BsDomain->turnOff()
8: htdocs\domains\dom_ctrl.php3:107

Cause:

Due to the missing entries “serial” and “serial_format” in the table “dns_zone”(under psa database).

Solution:

mysql -u admin -p `cat /etc/psa/.psa.shadow`
(Log in to mysql using Plesk’s stored password)

mysql> use psa
(Select Plesk’s database)

mysql> describe dns_zone;
(Check if there are rows titled serial and serial_format. If not, perform the steps below)

mysql> ALTER TABLE `dns_zone` add `serial` VARCHAR( 12 ) CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT ‘0′;
mysql> ALTER TABLE `dns_zone` add `serial_format` ENUM( ‘UNIXTIMESTAMP’, ‘YYYYMMDDNN’ ) NOT NULL DEFAULT ‘UNIXTIMESTAMP’;
(Add the appropriate rows to the dns_zone table.)

describe dns_zone;
Should look something like:

+—————+————————————+——+—–+—————+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+————————————+——+—–+—————+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | | | |
| displayName | varchar(255) | NO | | | |
| status | int(10) unsigned | NO | | 0 | |
| email | varchar(255) | YES | | NULL | |
| type | enum(’slave’,'master’) | NO | | master | |
| ttl | int(10) unsigned | NO | | 86400 | |
| ttl_unit | int(10) unsigned | NO | | 1 | |
| refresh | int(10) unsigned | NO | | 10800 | |
| refresh_unit | int(10) unsigned | NO | | 1 | |
| retry | int(10) unsigned | NO | | 3600 | |
| retry_unit | int(10) unsigned | NO | | 1 | |
| expire | int(10) unsigned | NO | | 604800 | |
| expire_unit | int(10) unsigned | NO | | 1 | |
| minimum | int(10) unsigned | NO | | 10800 | |
| minimum_unit | int(10) unsigned | NO | | 1 | |
| serial | varchar(12) | NO | | 0 | |
| serial_format | enum(’UNIXTIMESTAMP’,'YYYYMMDDNN’) | NO | | UNIXTIMESTAMP | |
+—————+————————————+——+—–+—————+—————-+
18 rows in set (0.00 sec)