Re: Can not add foreign key constraint

2017-04-24 Thread Peter Brawley
On 4/24/2017 20:47, David Mehler wrote: Hello, Thanks. Here's the create statements for virtual_domains, virtual_users, and the one that isn't working lastauth: CREATE TABLE `virtual_domains` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL, PRIMARY KEY (`id`) )

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, Thanks. Here's the create statements for virtual_domains, virtual_users, and the one that isn't working lastauth: CREATE TABLE `virtual_domains` ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE

Re: DATETIME vs CHAR for "timestamp"

2017-04-24 Thread SSC_perl
> On Apr 14, 2017, at 1:07 PM, shawn l.green wrote: > > That all depends. Do you... Hi Shawn, I thought I had replied to your response, but it looks like I didn’t. Thank you for your email. It was a thorough response and the links were very helpful, as

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, I'm running Mysql 5.7.18. My virtual_users are working fine, it's the new table that isn't. Or am I missing something? Thanks. Dave. On 4/24/17, Peter Brawley wrote: > On 4/24/2017 17:41, David Mehler wrote: >> Hello, >> >> Here's the output. I hope it

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, Here's the output. I hope it helps. root@localhost [mail]> CREATE TABLE IF NOT EXISTS `lastauth` ( -> `user` varchar(40) NOT NULL, -> `remote_ip` varchar(18) NOT NULL, -> `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -> PRIMARY KEY

Re: Can not add foreign key constraint

2017-04-24 Thread Peter Brawley
On 4/24/2017 15:28, Peter Brawley wrote: On 4/24/2017 13:59, David Mehler wrote: Hello, root@localhost [mail]> show engine innodb_status; ERROR 1286 (42000): Unknown storage engine 'innodb_status' Well it's very unlikely InnoDB made that up, it's probably in one of your Create texts. Ah,

Re: Can not add foreign key constraint

2017-04-24 Thread shawn l.green
On 4/24/2017 2:10 PM, Peter Brawley wrote: On 4/24/2017 12:28, David Mehler wrote: ...snip Adding in a dummy Create Table for the missing referenced `virtual_domains`, we have ... drop table if exists lastauth, virtual_users, virtual_domains; CREATE TABLE virtual_domains ( id int

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, Here's the engines I have: root@localhost [(none)]> show engines; ++-++--+--++ | Engine | Support | Comment | Transactions | XA |

Re: Can not add foreign key constraint

2017-04-24 Thread Peter Brawley
On 4/24/2017 13:59, David Mehler wrote: Hello, root@localhost [mail]> show engine innodb_status; ERROR 1286 (42000): Unknown storage engine 'innodb_status' Well it's very unlikely InnoDB made that up, it's probably in one of your Create texts. PB - This is on a Mysql 5.7 setup.

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, root@localhost [mail]> show engine innodb_status; ERROR 1286 (42000): Unknown storage engine 'innodb_status' This is on a Mysql 5.7 setup. Thanks. Dave. On 4/24/17, Peter Brawley wrote: > On 4/24/2017 12:28, David Mehler wrote: >> Hello, >> >>Here's

Re: Can not add foreign key constraint

2017-04-24 Thread Peter Brawley
On 4/24/2017 12:28, David Mehler wrote: Hello, Here's the create table sand error message. root@localhost [(none)]> use mail; Database changed root@localhost [mail]> CREATE TABLE IF NOT EXISTS `lastauth` ( -> `user` varchar(40) NOT NULL, -> `remote_ip` varchar(18) NOT

Re: Can not add foreign key constraint

2017-04-24 Thread David Mehler
Hello, Here's the create table sand error message. root@localhost [(none)]> use mail; Database changed root@localhost [mail]> CREATE TABLE IF NOT EXISTS `lastauth` ( -> `user` varchar(40) NOT NULL, -> `remote_ip` varchar(18) NOT NULL, -> `timestamp` timestamp NOT NULL

Re: Can not add foreign key constraints

2017-04-24 Thread Peter Brawley
On 4/24/2017 9:18, David Mehler wrote: Hello, I'm trying to add a table to an existing database. I'm wanting it to get one of it's fields from an already existing table. I've done this before in this database. This works: CREATE TABLE `virtual_users` ( `id` int(11) NOT NULL

Re: Can not add foreign key constraints

2017-04-24 Thread Reindl Harald
Am 24.04.2017 um 16:18 schrieb David Mehler: I'm trying to add a table to an existing database. I'm wanting it to get one of it's fields from an already existing table. I've done this before in this database. This works: CREATE TABLE `virtual_users` ( `id` int(11) NOT NULL

Can not add foreign key constraints

2017-04-24 Thread David Mehler
Hello, I'm trying to add a table to an existing database. I'm wanting it to get one of it's fields from an already existing table. I've done this before in this database. This works: CREATE TABLE `virtual_users` ( `id` int(11) NOT NULL auto_increment, `domain_id` int(11) NOT NULL,