Page 1 of 1

Error Code: 1364

Posted: Sat Feb 11, 2017 10:57 am
by jhonde
The application encountered a fatal database error.

Error Code:

1364

Error Message:

Field 'RealName' doesn't have a default value

MySQL Query:

INSERT INTO Accounts (Email, PassHash, PermGroup)
VALUES ('admin', 'ca793c101e80a32ecb4d2ce743eba3c04231cba36e46fc4aab90d2ca0d0da778', 2)

Re: Error Code: 1364

Posted: Tue Apr 11, 2017 2:56 pm
by bitfreak
Probably due to your mysql configuration according to this: mysql error 1364 Field doesn't have a default values

Re: Error Code: 1364

Posted: Wed Apr 12, 2017 4:03 pm
by bitfreak
As I was updating BitShop to work with PHP 7 I had a similar problem so I assume it's something to do with the default settings of newer versions of MySQL. I just released a new version of BitShop and I have included a sql script in the installation folder which should allow you to fix your existing database and get rid of these errors. If you do a fresh install of BitShop v1.1.3 then you wont need to apply the fix obviously. For anyone having issues with creating new products or placing new orders, this fix should help with that too. Here is the MySQL fix for those who cannot download the latest version of BitShop:

Code: Select all

ALTER TABLE Products MODIFY COLUMN FileVoteSum INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE Products MODIFY COLUMN FileVoteNum INT UNSIGNED NOT NULL DEFAULT 0;

ALTER TABLE Accounts MODIFY COLUMN PassHash VARCHAR(64) NOT NULL DEFAULT '';
ALTER TABLE Accounts MODIFY COLUMN RealName VARCHAR(50) NOT NULL DEFAULT '';
ALTER TABLE Accounts MODIFY COLUMN Email varchar(50) NOT NULL DEFAULT '';
ALTER TABLE Accounts MODIFY COLUMN Phone VARCHAR(20) NOT NULL DEFAULT '';
ALTER TABLE Accounts MODIFY COLUMN Settings TINYTEXT;
ALTER TABLE Accounts MODIFY COLUMN LastIP TINYTEXT;

ALTER TABLE Orders MODIFY COLUMN Amount DECIMAL(18,8) NOT NULL DEFAULT 0;
ALTER TABLE Orders MODIFY COLUMN Currency VARCHAR(5) NOT NULL DEFAULT '';