Hi Wido,

You're right, MySQL 5.7 has by default strict(er) sql mode enabled. To make 
CloudStack work with MySQL 5.7, changing the sql mode makes MySQL 5.7 behave 
like 5.6 with which the mgmt server/usage server should work.


Regards.

________________________________
From: Wido den Hollander <w...@widodh.nl>
Sent: 10 April 2017 20:30:55
To: dev@cloudstack.apache.org
Subject: MySQL 5.7 and SQL Mode

Hi,

While testing with Ubuntu 16.04 and CloudStack 4.10 (from master) I've ran into 
this error on the management server:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of 
SELECT list is not in GROUP BY clause and contains nonaggregated column 
'cloud.i.id' which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by
        at sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown 
Source)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
        at com.mysql.jdbc.Util.getInstance(Util.java:387)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)

I was able to fix this to add this to my my.cnf:

[mysqld]
sql_mode = 
"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Should we maybe set the SQL Mode as a connection parameter when connecting to 
the DB? This prevents users from having to set this manually in their MySQL 
configuration.

Did somebody else run into this with MySQL 5.7?

Thank you,

Wido

rohit.ya...@shapeblue.com 
www.shapeblue.com
53 Chandos Place, Covent Garden, London  WC2N 4HSUK
@shapeblue
  
 

Reply via email to