Archive for the ‘DataBase’ Category

22 05 2012

I cannot add a new domain because of existing DNS records

bigCat Posted in Linux, DataBase - 0 Comment

http://kb.parallels.com/en/1364\r\n\r\n\r\nAPPLIES TO:\r\nParallels Plesk Panel\r\nSymptoms\r\nAn attempt at new domain creation fails, and the following error is shown:\r\n\r\nDNS records for domain with such name already exist\r\n\r\nor\r\n\r\nThe subdomain with such name already exists\r\n\r\n\r\nCause\r\nA DNS record for the domain you are trying to add already exists in the Parallels Plesk Panel (PP) database, so a new domain with the same name cannot be added.\r\n\r\nResolution\r\nTry to find a record with a similar name in the DNS settings of the existing domains.\r\n\r\nIf it is difficult to find it manually, you may follow these steps:\r\n\r\n1. Open the "psa" database:\r\nLinux:\r\n# mysql -uadmin -p`cat /etc/psa/.psa.shadow` -Dpsa\r\n\r\nWindows:\r\nRefer to this article: 3472 [How To] How to access Parallels Plesk Panel database\r\n2. Run the following query to find the DNS record preventing new domain creation (replace YOUR-DOMAIN with the real name of the domain you are trying to create):\r\nLinux:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%YOUR-DOMAIN%';\r\n\r\nWindows:\r\nFor MSSQL and MySQL DB provider:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%YOUR-DOMAIN%';\r\n\r\nFor MS Access DB provider:\r\n> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '*YOUR-DOMAIN*';\r\n\r\nExample:\r\n\r\nYou try to create a domain called "support.mydomain.com," but the above error appears. The above shell command returns the following output:\r\nmysql> select z.name, r.host, r.type, r.val from dns_zone z, dns_recs r where z.id=r.dns_zone_id and r.host like '%support.mydomain.com%';\r\n\r\n+-------------+-----------------------+------+----------------+\r\n| name | host | type | val |\r\n+-------------+-----------------------+------+----------------+\r\n| mydomain.com| support.mydomain.com. | A | 192.168.45.200 |\r\n+-------------+-----------------------+------+----------------+\r\n\r\nYou need to open the corresponding domain (mydomain.com in our example) in the PP Web Interface and examine its DNS zone for the records that contain name of the domain you tried to add. If you want to create the "support.mydomain.com" domain as a separate domain in PP, then the existing record with a similar name has to be removed from the "mydomain.com" DNS zone.\r\n\r\n\r\nAnother possible case:\r\n\r\nA DNS record may exist in the dns_recs table, but have no PP domain associated with it. This may be because of a failed domain removal in the past. You can remove such records directly from the dns_recs table using the below query.\r\n\r\nNote: Make sure you back up the "psa" database modifying it.\r\nLinux:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '%domain.com%';\r\n\r\nWindows:\r\nFor MSSQL and MySQL DB provider:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '%domain.com%';\r\n\r\nFor MS Access DB provider:\r\n> DELETE FROM `dns_recs` WHERE DisplayHost LIKE '*domain.com*';\r\n

2 09 2010

常用的MySQL数据类型

bigCat Posted in DataBase - 0 Comment

本文转自让理想飞起来\r\n感谢作者的汇总:)\r\n\r\n===\r\n最常用的MySQL数据类型是VARCHAR, DECIMAL, DATE, INT, TEXT 和 TIMESTAMP。\r\n\r\n第一个:\r\n\r\nVARCHAR通常用来表示最多为255个字符的变量长度字符串。如果你要储存和处理字母数字类的数据,这种数据类型是最合适的。适用于这类数据的典型例 子包括人名,邮政编码,电话号码和不超过255个字符长度的任意字母数字组合。那些要用来计算的数字不要用VARCHAR类型保存,因为可能会导致一些与 计算相关的问题。换句话说,可能影响到计算的准确性和完整性。\r\n\r\n第二个:\r\n\r\n \r\n\r\nDECIMAL最适合保存那些将被用于计算的数据。在MySQL中,我们可以指定保存一些正当的数字。还可以指定是否允许存在负值。\r\n\r\n指定DECIMAL类型的长度会有些棘手。例如,如果你需要在小数点前面保存五位数,且小数点后只保留三位,那么在数据库中其适当的长度将 是:Decimal(5+3,3)或 Decimal(8,3),可以使用的数据包括:12345.678,56872.690,11.6和12.568等。而这些数字则会引发出错信 息:128781.1,8972865.231。\r\n\r\n第三个:\r\n\r\n建议用DATE数据类型来保存日期。MySQL中默认的日期格式是yyyy-mm-dd。\r\n\r\n第四个:\r\n\r\nINT数据类型可以用来保存那些不包含小数点的数字。INT代表整数。\r\n有些整数类型以及他们最多所能拥有的数字位我们必须有所了解:\r\n\r\n·TINYINT——这个类型最多可容纳三位数。\r\n·SMALLINT——最多可容纳五位数。\r\n·MEDIUMINT——最多可容纳八位数。\r\n·INT——可以容纳十位数。\r\n·BIGINT——最多可容纳二十位数。\r\n\r\n第五个:\r\n\r\nTEXT可以接受文本输入,VARCHAR只能接受255个字符,但是TEXT可以用来存储超量的数据。\r\n\r\n第六个:\r\n\r\n当TIMESTAMP数据类型被选定,可以点击“CURRENT_TIMESTAMP”作为默认,MySQL会自动返回每个MySQL数据插入的确切时间。\r\n\r\n===\r\n\r\n下面是一些推荐的数据库设计规格:\r\n1. 第一个数值域:\r\n\r\n要收集的数据:客户姓名\r\n推荐域名:customername\r\nMySQL数据类型:VARCHAR\r\n允许的客户名最大长度:64\r\n\r\n2. 第二个数值域:\r\n\r\n要收集的数据:价格\r\n推荐域名:price\r\nMySQL数据类型:DECIMAL\r\n小数点前最多允许位数:4\r\n小数点后保留到3位\r\n最终的小数位长度:DECIMAL(4+3, 3) 或者 DECIMAL(7, 3)\r\n不允许出现负值\r\n\r\n3. 第三个数值域:\r\n\r\n要收集的数据:购买日期\r\n推荐域名:datepurchased\r\nMySQL数据类型:DATE\r\n最大长度:不可用\r\n\r\n4. 第四个数值域:\r\n\r\n要收集的数据:产品序列号\r\n推荐域名:productkey\r\nMySQL数据类型:SMALLINT\r\n该变量的最大长度:5\r\n其他属性:少于5时用0填补,不允许出现负值\r\n\r\n5. 第五个数值域:\r\n\r\n要收集的数据:投诉细则\r\n推荐域名:complaintdetails\r\nMySQL数据类型:TEXT\r\n最大字符长度:取决于用户的输入情况\r\n\r\n6. 第六个数值域:\r\n

要收集的数据:投诉受理日期\r\n推荐域名:reveivingdate\r\nMySQL数据类型:TIMESTAMP\r\n其他属性:为Current_Timestamp设置默认值,这样它便可以记录投诉的确切时间。\r\n===

Host: (miao) | Word: Press | Code: HTML5