You are not logged in.

#1 2015-10-31 12:38:45

Axon
Member
From: Saint Petersburg
Registered: 2012-02-19
Posts: 22

Error creating tables for dbmail in mariadb (solved)

Hello!
I'm trying to setup dbmail with mariasb, and run into a problem importing the tables from sql file shipped with the package.

mysql -u dbmail dbmail -p < /usr/share/dbmail/mysql/create_tables.mysql
Enter password: ******
ERROR 1005 (HY000) at line 401: Can't create table `dbmail`.`dbmail_auto_replies` (errno: 121 "Duplicate key on write or update")

Here is the query that fails:

CREATE TABLE dbmail_auto_replies (                                                                                    
        user_idnr bigint(20) UNSIGNED DEFAULT '0' NOT NULL,
        start_date DATETIME NOT NULL,
        stop_date DATETIME NOT NULL,
        reply_body MEDIUMTEXT,
        INDEX user_idnr_index (user_idnr),
        FOREIGN KEY user_idnr_fk (user_idnr)
                REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE InnoDB DEFAULT CHARSET=utf8;

I've tried it with mysql 5.5.46, on the other system, and it worked fine. Isn't mariadb supposed to be a drop-in replacement for mysql? And if not, can someone point out what is wrong with this query and how to adapt it to mariadb?

Last edited by Axon (2015-10-31 20:13:59)

Offline

#2 2015-10-31 20:10:38

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Error creating tables for dbmail in mariadb (solved)

Are you sure the foreign key is unique within your database?


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#3 2015-10-31 20:12:55

Axon
Member
From: Saint Petersburg
Registered: 2012-02-19
Posts: 22

Re: Error creating tables for dbmail in mariadb (solved)

Yeah, I actually solved it already. The key is not unique and why mysql ignores that fact is a mistery. I'm gonna report this to upstream and close this thread.

Offline

#4 2017-10-12 07:20:18

raba34
Member
Registered: 2017-10-12
Posts: 1

Re: Error creating tables for dbmail in mariadb (solved)

Hello Axon,

I have the same problem if I create the table of dbmail (Duplicate key...).

You had written you had solved the problem, but you don't have write, what you had done.

Coud you tell me what you had made to solve this problem, please?

Thanks and greetings

Ralph

Offline

#5 2017-10-12 08:28:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,736

Re: Error creating tables for dbmail in mariadb (solved)

Either manually change the key or go complain to dbmail that they are using a duplicate key in their dump, it's pretty clearly stated here.

Please refrain from necrobumping solved threads, create your own if you require assistance.

https://wiki.archlinux.org/index.php/Co … bumping.22

Closing.

Offline

Board footer

Powered by FluxBB