Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install error in mysql strict mode #1140

Closed
valinorius opened this issue Jan 14, 2014 · 2 comments
Closed

Install error in mysql strict mode #1140

valinorius opened this issue Jan 14, 2014 · 2 comments

Comments

@valinorius
Copy link

2014/01/14 14:40:17 [error] 27320#0: *16 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'ErrorException' with message 'Error: Field 'image' doesn't have a default value
Error No: 1364

INSERT INTO oc_option_value (option_value_id, option_id, sort_order) VALUES
(43, 1, 3),
(32, 1, 1),
(45, 2, 4),
(44, 2, 3),
(42, 5, 4),
(41, 5, 3),
(39, 5, 1),
(40, 5, 2),
(31, 1, 2),
(23, 2, 1),
(24, 2, 2),
(46, 11, 1),
(47, 11, 2),
(48, 11, 3);
' in /home/mihael/opencart/upload/system/database/mysqli.php:40
Stack trace:
#0 /home/mihael/opencart/upload/system/library/db.php(20): DBMySQLi->query('??INSERT INTO ...') #1 /home/mihael/opencart/upload/install/model/install.php(26): DB->query('??INSERT INTO ...')
#2 /home/mihael/opencart/upload/install/controller/step_3.php(9): ModelInstall->database(Array)
#3 [internal function]: ControllerStep3->index()
#4 /home/mihael/opencart/upload/system/engine/front.php(42): call_user_func_array(Array, Array)
#5 /home/mihael/opencart/upload/system/engine/front.php(29): Front->execute(Object(Action))
#6 /h" while reading response header from upstream, client: 127.0.0.1, server: opencart.dev, request: "POST /install/index.php?route=step_3 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "opencart.dev", referrer: "http://opencart.dev/install/index.php?route=step_3"

@jamesallsup
Copy link
Contributor

Disable strict mode - it is not required.

It looks like it is forcing every database column insert to have a value, even if its empty / null.

@marauder37
Copy link

This breaks the default install on OSX and took several hours for me to work out and fix. Please at least consider catching and displaying errors that occur during the database build. Otherwise all I get is a blank document. Unfortunate that my first experience of OpenCart involved a trip through its internals, and mysql's internals, on top of the nonsense with mcrypt that we can thank Apple for.

For other people who get this far, try:

-- see what mode the server's in:

SELECT @@sql_mode;

-- change the mode to remove STRICT_TRANS_TABLES or whatever might be causing the trouble:

set global sql_mode = 'NO_ENGINE_SUBSTITUTION';

-- then drop the opencart database and start again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants