gpt4 book ai didi

mysql - 列数、整数值、数据被截断和其他一些消息

转载 作者:行者123 更新时间:2023-11-30 23:09:06 34 4
gpt4 key购买 nike

我已经为我的数据库苦苦挣扎了一段时间,几乎不可能找到我的老师。我的代码如下:

INSERT INTO `database28`.`activity`
VALUES
("Stefan", 1.1.2.2, "Dator", "Mozilla" );

INSERT INTO `database28`.`activity`
VALUES
("Ulf", 1.1.3.3, "Mobil", "Safari" );

INSERT INTO `database28`.`activity`
VALUES
("Göran", 1.1.4.4, "surfplatta", "opera" );

INSERT INTO `database28`.`activity`
VALUES
("Berit", 1.1.5.5, "Dator", "Internet Explorer");

INSERT INTO `database28`.`activity`
VALUES
("Arne", 1.1.6.6, "Mobil", "Chrome");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Success Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("failure Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Information");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Warning");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Error");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(1, 11:00, "Server 1", "Stefan", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, 12:00, "Server 2", "Ulf", "Databas2", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, 13:00, "Server 1", "Mats", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, 11:00, "Server 1", "Arne", "Databas1", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, 21:00, "Server 1", "Berit", "Databas1", "exe");

然而,这给我留下了几个错误消息,我当然不会一次得到所有错误消息,但是当我尝试更改某些内容时,我似乎使情况变得更糟。有任何想法吗?

最佳答案

activity 表和log 表的插入查询中忘记加QUOTE Mark

试试这个:

INSERT INTO `database28`.`activity`
VALUES
("Stefan", '1.1.2.2', "Dator", "Mozilla" );

INSERT INTO `database28`.`activity`
VALUES
("Ulf", '1.1.3.3', "Mobil", "Safari" );

INSERT INTO `database28`.`activity`
VALUES
("Göran", '1.1.4.4', "surfplatta", "opera" );

INSERT INTO `database28`.`activity`
VALUES
("Berit", '1.1.5.5', "Dator", "Internet Explorer");

INSERT INTO `database28`.`activity`
VALUES
("Arne", '1.1.6.6', "Mobil", "Chrome");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Till", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Privat");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas2", "Från", "Företag");

INSERT INTO `database28`.`destination`
(`Destination`,
`Direction`,
`Klient`)
VALUES
("Databas1", "Till", "Privat");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Success Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("failure Audit");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Information");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Warning");

INSERT INTO `database28`.`eventtype`
(`EventID`,
`Namn`)
VALUES
("Error");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(1, '11:00', "Server 1", "Stefan", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, '12:00', "Server 2", "Ulf", "Databas2", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, '13:00', "Server 1", "Mats", "Databas1", "System");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(2, '11:00', "Server 1", "Arne", "Databas1", "exe");

INSERT INTO `database28`.`log`
(`LogID`,
`Tid`,
`Serverr`,
`ActID`,
`Destination`,
`Källa`)
VALUES
(3, '21:00', "Server 1", "Berit", "Databas1", "exe");

关于mysql - 列数、整数值、数据被截断和其他一些消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20608093/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com