Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
MySQL error during install of Vanilla 2.6
Sealord
New
I get this error when I hit continue button in the Version 2.6 Installer
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Admin = ?' at line 4
MySQL version is 8.0.11.0
0
Comments
Disable MySQL's Strict Mode to proceed.
Strict Mode is/was disabled, no success with Vanilla 2.6
Vanilla 2.5.2 works on my server.
Clean installation of Vanilla 2.6 on Windows/IIS, exact same problem. Strict Mode is disabled (sql-mode = "NO_ENGINE_SUBSTITUTION", is this OK?). MySQL version is 8.0. I also have Debug=true in my config.php; not sure if it matters at this point. Total noob here; any suggestion would be greatly appreciated.
I tried the Vanilla 2.5.2 Installer and I get the exact same error.
I enabled debug and got this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Admin = ?' at line 4
## C:\vanilla-core-2-6\library\database\class.database.php(421)
#0 [internal function]: gdn_ErrorHandler(256, 'You have an err...', 'C:\vanilla-core...', 421, Array)
#1 C:\vanilla-core-2-6\library\database\class.database.php(421): trigger_error('You have an err...', 256)
#2 C:\vanilla-core-2-6\library\database\class.sqldriver.php(1684): Gdn_Database->query('select *\nfrom G...', Array, Array)
#3 C:\vanilla-core-2-6\library\database\class.sqldriver.php(902): Gdn_SQLDriver->query('select *\nfrom G...')
#4 C:\vanilla-core-2-6\applications\dashboard\settings\structure.php(138): Gdn_SQLDriver->getWhere('User', Array)
#5 C:\vanilla-core-2-6\applications\dashboard\controllers\class.setupcontroller.php(251): include('C:\vanilla-core...')
#6 C:\vanilla-core-2-6\applications\dashboard\controllers\class.setupcontroller.php(89): SetupController->configure()
#7 C:\vanilla-core-2-6\library\core\class.dispatcher.php(845): SetupController->index()
#8 C:\vanilla-core-2-6\library\core\class.dispatcher.php(274): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array)
#9 C:\vanilla-core-2-6\index.php(30): Gdn_Dispatcher->dispatch()
#10 {main}
I found that this line in applications\dashboard\settings\structure.php was failing:
So I commented out some code in that file, knowing that there was no system user yet:
This allowed me to get a little further (404, addons not found, etc). The installation had already created two database tables before my change, but the gdn_user table was empty. After the change, several users were added to that table, including my system user.
The question is, what in that statement made it throw an error? And will other statements have the same problem? It's connecting to the database, and many statements succeed. What is different about that one? Is it somehow incompatible with some new default setting in MySQL 8.0.11.0 where other statements are not? Is the new version throwing errors instead of warnings or something like that? Any insight would be appreciated.
Could you try changing it to
... 'Admin' => '2'...
I would also assume that it is a Strict Mode problem
Thanks for your reply. Unfortunately, your suggestion didn't work. I got the exact same error after surrounding the 2 in single quotes. (I did this in 5.2.2, which I was trying as a fallback, but the code at that point is exactly the same.)
As far as Strict Mode, it is disabled. I even changed sql-mode to
sql-mode = ""
in my MySQL my.ini, to no avail.A similar error popped up, as I feared. I attempted to change my system user password. This is what I got:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Admin, Password from GDN_User `User` where UserID = ?' at line 1
The error occurred on or near: C:\vanilla-core-2-6\library\database\class.database.php
Backtrace:
Variables in local scope:
OK, I gave up on MySQL. I installed MariaDB instead, rerun the Vanilla installation, and it went smoothly. No more SQL errors. Only the known issue with the vanilla and conversations addons remains.
The SQL problem is probably caused by one of the new defaults in MySQL 8. I don't have the time (nor the inclination right now) to try and figure out which one. MariaDB 10.3 works for me.
Thanks for all your help.
Maybe it has something to do with this one:
Admin is a reserved keyword in MySQL8
https://dev.mysql.com/doc/refman/8.0/en/keywords.html
Admin became nonreserved in next version 8.0.12
I have also changed to MariaDB now!
Good finding! I've created an issue on GitHub based on that.
MySQL 8.0.12 is released and Vanilla 2.6 installation works now with this version.