我正在尝试在本地服务器 XAMPP 中加载数据库,但它一直给我这个错误。
我的 table
CREATE TABLE `transactions_client_view` (
`name` VARCHAR(255) NOT NULL DEFAULT '',
`surname` VARCHAR(255) NOT NULL DEFAULT '',
`actualcredit` DOUBLE(10) NOT NULL DEFAULT '0.00000',
`amount` DOUBLE(10) NOT NULL DEFAULT '0.00000',
`date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`error` VARCHAR(255) NOT NULL DEFAULT '',
`client_id` INT(11) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM;
错误
ERROR 1064 (42000) at line 361239: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') NOT NULL DEFAULT '',
amount
DOUBLE(10) NOT NULL DEFAULT '', `date' at line 4
最佳答案
试试这个
CREATE TABLE `transactions_client_view` (
`name` VARCHAR(255) NOT NULL DEFAULT '',
`surname` VARCHAR(255) NOT NULL DEFAULT '',
`actualcredit` DOUBLE NOT NULL DEFAULT '0.00000',
`amount` DOUBLE NOT NULL DEFAULT '0.00000',
`date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`error` VARCHAR(255) NOT NULL DEFAULT '',
`client_id` INT(11) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM;
关于mysql - MariaDB 如何避免错误 NOT NULL DEFAULT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50149069/