Moving to MySQL
Posted: Wed Sep 16, 2015 11:50 pm
Hey all, just working through getting the demo running on mysql and am getting
[artifact:mvn] [ WARN] 22:16:13 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [blSandBoxElements]; using defaults.
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - HHH000389: Unsuccessful: alter table BLC_ADDITIONAL_OFFER_INFO drop foreign key FK3BFDBD63B5D9C34D
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - ALTER command denied to user 'xxx'@'localhost' for table 'blc_additional_offer_info'
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - ALTER command denied to user 'xxx'@'localhost' for table 'blc_additional_offer_info'
... and this repeats hundreds of times.
So a couple of things. 1) The obvious thing is that user 'xxx' does not have permissions. Going to mysql I gave myself (I think) all permissions: AM I WRONG ?
mysql> show grants;
+-------------------------------------------------------------------------------------+
| Grants for xxx@localhost |
+-------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'xxx'@'localhost' IDENTIFIED BY PASSWORD <secret> |
| GRANT ALL PRIVILEGES ON `mysql`.`gophergroceries` TO 'xxx'@'localhost' |
| GRANT ALL PRIVILEGES ON `gophergroceries`.`gophergroceries` TO 'xxx'@'localhost' |
+-------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
2)the first errors are on trying to ALTER a table. Maybe the tables are not created? Correct, they are not created.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| gophergroceries |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> connect gophergroceries;
Connection id: 145
Current database: gophergroceries
mysql> show tables;
Empty set (0.00 sec)
So what gives. I know the scripts are being executed ...... but the tables are not being created ...... they were created using the in memory database .... maybe I better check the scripts -> different syntax?
Checking what scripts and where they are we have the line.
blPU.hibernate.hbm2ddl.import_files=/config/bc/sql/load_admin_permissions.sql,\
/config/bc/sql/load_admin_roles.sql,\
/config/bc/sql/load_admin_menu.sql,\
/config/bc/sql/load_menu_admin_security.sql,\
/sql/load_admin_users.sql,\
/sql/load_code_tables.sql,\
/sql/load_i18n_countries.sql,\
/sql/load_table_sequences.sql,\
/sql/load_content_structure.sql,\
/sql/load_catalog_data.sql,\
/sql/load_content_data.sql,\
/sql/load_content_structure_i18n.sql,\
/sql/load_content_data_i18n.sql,\
/sql/load_catalog_i18n_data_FR.sql,\
/sql/load_catalog_i18n_data_ES.sql,\
/sql/load_sitemap_data.sql,\
/sql/load_menu_data.sql
- BUT I can only find the files under the directory sql! there is no config/bc/sql directory in the project! What gives?
As well there is a comment at the top of each file "The Archetype is configured with "hibernate.hbm2ddl.auto" value="create-drop" in "persistence.xml".". I get it and have set the value to create-drop in the development environment properties, but still no joy. In actual fact there is no such file as persitence.xml file - am I supposed to create one? where?
Anyone been through this before?
Thanks!:)
[artifact:mvn] [ WARN] 22:16:13 AbstractEhcacheRegionFactory - HHH020003: Could not find a specific ehcache configuration for cache named [blSandBoxElements]; using defaults.
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - HHH000389: Unsuccessful: alter table BLC_ADDITIONAL_OFFER_INFO drop foreign key FK3BFDBD63B5D9C34D
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - ALTER command denied to user 'xxx'@'localhost' for table 'blc_additional_offer_info'
[artifact:mvn] [ERROR] 22:16:13 SchemaExport - ALTER command denied to user 'xxx'@'localhost' for table 'blc_additional_offer_info'
... and this repeats hundreds of times.
So a couple of things. 1) The obvious thing is that user 'xxx' does not have permissions. Going to mysql I gave myself (I think) all permissions: AM I WRONG ?
mysql> show grants;
+-------------------------------------------------------------------------------------+
| Grants for xxx@localhost |
+-------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'xxx'@'localhost' IDENTIFIED BY PASSWORD <secret> |
| GRANT ALL PRIVILEGES ON `mysql`.`gophergroceries` TO 'xxx'@'localhost' |
| GRANT ALL PRIVILEGES ON `gophergroceries`.`gophergroceries` TO 'xxx'@'localhost' |
+-------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
2)the first errors are on trying to ALTER a table. Maybe the tables are not created? Correct, they are not created.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| gophergroceries |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> connect gophergroceries;
Connection id: 145
Current database: gophergroceries
mysql> show tables;
Empty set (0.00 sec)
So what gives. I know the scripts are being executed ...... but the tables are not being created ...... they were created using the in memory database .... maybe I better check the scripts -> different syntax?
Checking what scripts and where they are we have the line.
blPU.hibernate.hbm2ddl.import_files=/config/bc/sql/load_admin_permissions.sql,\
/config/bc/sql/load_admin_roles.sql,\
/config/bc/sql/load_admin_menu.sql,\
/config/bc/sql/load_menu_admin_security.sql,\
/sql/load_admin_users.sql,\
/sql/load_code_tables.sql,\
/sql/load_i18n_countries.sql,\
/sql/load_table_sequences.sql,\
/sql/load_content_structure.sql,\
/sql/load_catalog_data.sql,\
/sql/load_content_data.sql,\
/sql/load_content_structure_i18n.sql,\
/sql/load_content_data_i18n.sql,\
/sql/load_catalog_i18n_data_FR.sql,\
/sql/load_catalog_i18n_data_ES.sql,\
/sql/load_sitemap_data.sql,\
/sql/load_menu_data.sql
- BUT I can only find the files under the directory sql! there is no config/bc/sql directory in the project! What gives?
As well there is a comment at the top of each file "The Archetype is configured with "hibernate.hbm2ddl.auto" value="create-drop" in "persistence.xml".". I get it and have set the value to create-drop in the development environment properties, but still no joy. In actual fact there is no such file as persitence.xml file - am I supposed to create one? where?
Anyone been through this before?
Thanks!:)