2

We have 2 computers with a new Craft Pro trial installation. The files are exactly the same on both computers. We both use the same DB with the same db.php config settings. We can both see the site and login to the /admin section.

The only issue is that on 1 computer I can not create a Matrix field or install a plugin. Then I get the error:

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 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 'COLLATE=' at line 8

The other computer has no problem creating a Matrix field or installing a plugin. Any suggestions? Thanks!

  • 1
    Are the installs on two separate servers or are they on the same box? What version of MariaDB? Can you share the whole SQL statement that's trying to execute? – Brad Bell Mar 16 '16 at 19:50
  • Installations are on 2 different laptops, each have their own local environment. MariaDB Server version: 10.1.10 – SiteHopper Mar 17 '16 at 8:22
  • The specs of the one with the issue: Apache/2.4.16 (Unix) PHP/5.6.17 - MariaDB Server version: 10.1.10. On this link you will find the full debug output: pastebin.com/rFRRHvGU – SiteHopper Mar 17 '16 at 8:32
  • Actually, the DB is on a separate server that both laptops connect to. MySQL version: 5.6.26. But when I move the DB to my local MariaDB and connect to it I still have the same issue. – SiteHopper Mar 17 '16 at 8:40
  • We made a var_dump the method $this->setText($this->getConnection()->getSchema()->createTable($table, $columns, $options)); in file craft/app/framework/db/CDbCommand.php. On the computer with the issue we see CHARSET= COLLATE=. On the other computer we see: CHARSET=utf8 COLLATE=utf8_unicode_ci . see full var_dump here: pastebin.com/qYk0Lu7i – SiteHopper Mar 17 '16 at 9:13
1

Check to make sure you have a db.php file here:

craft/app/etc/config/defaults/db.php

If not, download a fresh copy of the version of Craft you're using and replace your craft/app folder with the one you just downloaded.

This file was missing in my Git repository because the .gitignore file was set to ignore all db.php files on the site, not just the one they wanted to ignore in the craft/config folder.

If that's the case, make sure your .gitignore file uses a line like this:

craft/config/db.php

Instead of just this:

db.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.