PDA

View Full Version : Problem on editing data on MySQL table


satimis
7th December 2008, 16:19
Hi folks,


I have a table tblPerdition created on dbPerdition


mysql> SHOW tables;
+-----------------------+
| Tables_in_dbPerdition |
+-----------------------+
| tblPerdition |
+-----------------------+
1 row in set (0.00 sec)




mysql> DESCRIBE tblPerdition;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| user | varchar(128) | NO | PRI | | |
| servername | varchar(255) | NO | | | |
| port | varchar(8) | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


On editing data on the table;


mysql> INSERT INTO user VALUES
-> ('userA@domainA.com'),
-> ('userA@domianB.com'),
-> ('userA@domainC.com');
ERROR 1146 (42S02): Table 'dbPerdition.user' doesn't exist



Please advise how to fix the problem? Whether I need to edit;
('userA'@'domainA.com')

???


TIA


B.R.
satimis

geek.de.nz
8th December 2008, 11:19
mysql> DESCRIBE tblPerdition;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| user | varchar(128) | NO | PRI | | |
| servername | varchar(255) | NO | | | |
| port | varchar(8) | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)



mysql> use dbPerdition;
->INSERT INTO tblPerdition (user, servername) VALUES
-> ('userA','domainA.com'),
-> ('userA','domianB.com'),
-> ('userA','domainC.com');

satimis
8th December 2008, 15:27
mysql> use dbPerdition;
->INSERT INTO tblPerdition (user, servername) VALUES
-> ('userA','domainA.com'),
-> ('userA','domianB.com'),
-> ('userA','domainC.com');


Hi geek.de.nz,


Thanks for your advice.

Ran;



mysql> INSERT INTO tblPerdition (user, servername) VALUES
-> ('satimis','satimis.com'),
-> ('satimis','satimis.changeip.net'),
-> ('satimis','satimis.dnsalias.com');

ERROR 1062 (23000): Duplicate entry 'satimis' for key 1


B.R.
satimis

marpada
10th December 2008, 01:35
user field is primary key, so you can't have duplicate values. Maybe you created the primary key wrong.

satimis
10th December 2008, 04:34
user field is primary key, so you can't have duplicate values. Maybe you created the primary key wrong.
I was following this document;
http://www.vergenet.net/linux/perdition/perditiondb.5.shtml

to config/setup perdition creating a MySQL table. The primary key is required there. Their mailing list can't help me out. I'm looking around for a solution.

Besides, the descriptor of Null is either YES or NO. It needs blank there.


satimis

marpada
11th December 2008, 23:57
Perdition supports a dynamic library mechanism to access arbitrary databases that resolve a user to a host and port.

The user field must also be a unique index as an exact match will be made of this field from the username supplied by the user.

If a user must be resolved to a host and a port is doesn't make sense that you try to add duplicate users, does it?

satimis
12th December 2008, 01:52
If a user must be resolved to a host and a port is doesn't make sense that you try to add duplicate users, does it?
Same user holding several email address must be allowed which is not considered as duplicate user (on MySQL table maybe). Actually the setup on 2 key components are critical, the config file of perdition and the table of the database, 'tblPerdition'.

The whole system is now working perfectly on Intranet. Incoming mails are routed by the routing mail server to their mail servers running as guests on the Xen box. Mail clients running on workstations on the Intranet can send and receive mails via their own mail server. If allotting each mail server a port my problem may be solved already. But this is NOT the goal of my test. Not many perdition document/link can be found on googling. If I can't solve my problem with Perdition I'll move to nginx.


B.R.
satimis