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

After system upgrade from 15.10 to 16.04 Ubuntu, I get sql error?? #1276

Closed
robmorin opened this issue Apr 28, 2016 · 5 comments
Closed

After system upgrade from 15.10 to 16.04 Ubuntu, I get sql error?? #1276

robmorin opened this issue Apr 28, 2016 · 5 comments

Comments

@robmorin
Copy link

Error: 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 ' label='SELECT * FROM teampass_languages GROUP BY name ORDER BY na' at line 3
Query: SELECT * FROM teampass_languages GROUP BY name ORDER BY name ASC

This si even after a re-install, of which i dropped the db and then installed fres with Ubuntu 16.04 which has php7.0 and Mysql 5.7

Any ideas?

@robmorin
Copy link
Author

More info:

When running the query manually in mysql prompt I get this error:

mysql> SELECT * FROM teampass_languages GROUP BY name ORDER BY name ASC;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'teampass.teampass_languages.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

I am no mysql/sql guru, but the column "id" does exist.

@BradStephens
Copy link

BradStephens commented Apr 29, 2016

I have the same error with a fresh installation on CentOS 7 with PHP 5.6, Percona 5.7 DB.

@BradStephens
Copy link

Editing line 104 of sources/core.php to look as follows resolved the issue.

$rows = DB::query("SELECT * FROM ".prefix_table("languages")." GROUP BY name, label, code, flag, id ORDER BY name ASC");

This is due to new behavior in MySQL 5.7 covered here:

http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_only_full_group_by

@robmorin
Copy link
Author

robmorin commented May 3, 2016

Yuppers this solution worked for me!
Thanks

@nilsteampassnet
Copy link
Owner

Thanks for reporting and debugging 👍

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