Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/conf/db.properties.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ db.cloud.testWhileIdle=true
db.cloud.timeBetweenEvictionRunsMillis=40000
db.cloud.minEvictableIdleTimeMillis=240000
db.cloud.poolPreparedStatements=false
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'

# CloudStack database SSL settings
db.cloud.useSSL=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ private static void initDB(String dbPropsFile, String rootPassword, String[] dat
List<String> queries = new ArrayList<String>();
queries.add(String.format("drop database if exists `%s`", dbName));
queries.add(String.format("create database `%s`", dbName));
queries.add(String.format("GRANT ALL ON %s.* to '%s'@`localhost` identified by '%s'", dbName, username, password));
queries.add(String.format("GRANT ALL ON %s.* to '%s'@`%%` identified by '%s'", dbName, username, password));
queries.add(String.format("CREATE USER IF NOT EXISTS %s@`localhost` identified by '%s'", username, password));
queries.add(String.format("CREATE USER IF NOT EXISTS %s@`%%` identified by '%s'", username, password));
queries.add(String.format("GRANT ALL ON %s.* to '%s'@`localhost`", dbName, username));
queries.add(String.format("GRANT ALL ON %s.* to '%s'@`%%`", dbName, username));

for (String query : queries) {
runQuery(host, port, rootPassword, query, dryRun);
Expand Down
4 changes: 2 additions & 2 deletions setup/db/create-database-simulator.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ DROP DATABASE IF EXISTS `simulator`;

CREATE DATABASE `simulator`;

GRANT ALL ON simulator.* to cloud@`localhost` identified by 'cloud';
GRANT ALL ON simulator.* to cloud@`%` identified by 'cloud';
GRANT ALL ON simulator.* to cloud@`localhost`;
GRANT ALL ON simulator.* to cloud@`%`;

GRANT process ON *.* TO cloud@`localhost`;
GRANT process ON *.* TO cloud@`%`;
Expand Down
7 changes: 4 additions & 3 deletions setup/db/create-database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ DROP DATABASE IF EXISTS `cloud`;

CREATE DATABASE `cloud`;

CREATE USER cloud identified by 'cloud';
CREATE USER cloud@`localhost` identified by 'cloud';
CREATE USER cloud@`%` identified by 'cloud';

GRANT ALL ON cloud.* to cloud@`localhost` identified by 'cloud';
GRANT ALL ON cloud.* to cloud@`%` identified by 'cloud';
GRANT ALL ON cloud.* to cloud@`localhost`;
GRANT ALL ON cloud.* to cloud@`%`;

GRANT process ON *.* TO cloud@`localhost`;
GRANT process ON *.* TO cloud@`%`;
Expand Down
2 changes: 1 addition & 1 deletion utils/conf/db.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ db.cloud.testWhileIdle=true
db.cloud.timeBetweenEvictionRunsMillis=40000
db.cloud.minEvictableIdleTimeMillis=240000
db.cloud.poolPreparedStatements=false
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'

# usage database settings
db.usage.username=cloud
Expand Down