"Nils Valentin" <[EMAIL PROTECTED]> wrote:
> 
> I try to create foreign keys in a innodb database. I read through some threats 
> and the manual, and several online resources, but somehow I am missing 
> something.
> 
> What I try to do is recreate the keys and their functions of the mysql 
> database (privilege database) as a innodb database, including foreign keys to 
> illustrate the relations.

You shouln't convert privilege tables to the InnoDB.

> 
> The copy of the mysql privilege database is called mysql_privileges_db_inno.
> 
> The 6 tables structure host, user, db etc. was copied to the innodb database 
> and then modified with ALTER.
> 
> Now when I try to create  a foreign key I get the famous Error 1105 which 
> tells me that I didnt form the request for the foreign key proberly.
> 
> mysql> ALTER TABLE db ADD FOREIGN KEY (User) REFERENCES user (User);
> ERROR 1005: Can't create table './mysql_privileges_db_inno/#sql-2e8_10.frm' 
> (errno: 150)

Column User in the table User must be indexed.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to