SQL-error when moving database
13 years 7 months ago #90626
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
SQL-error when moving database was created by jansuhr
This is an error I always get when moving the Joomla database and if it has Hikashop in it.
It has something to do with the hikashop_click_view table.
In the exported SQL-file it looks like this:
Rather than how I expect it to look.
What could be the cause? It is phpMyAdmin that exports the whole database but it is always the same error in the hikashop_click_view, hikashop_lead_view and hikashop_sale_view tables.
Jan
It has something to do with the hikashop_click_view table.
In the exported SQL-file it looks like this:
Code:
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `colorconsult`.`iqej4_hikashop_click_view` AS select `a`.`user_id` AS `user_id`,sum(`b`.`click_partner_price`) AS `click_price` from (`colorconsult`.`iqej4_hikashop_user` `a` left join `colorconsult`.`iqej4_hikashop_click` `b` on(((`a`.`user_id` = `b`.`click_partner_id`) and ((case when (`a`.`user_currency_id` = 0) then 150 else `a`.`user_currency_id` end) = `b`.`click_partner_currency_id`)))) where ((`a`.`user_partner_activated` = 1) and (`b`.`click_partner_paid` = 0)) group by `b`.`click_partner_id`;
Rather than how I expect it to look.
Code:
CREATE TABLE `colorconsult`.`iqej4_hikashop_click_view` (
`user_id` INT( 10 ) UNSIGNED NOT NULL ,
`click_price` DECIMAL( 34, 5 ) NULL DEFAULT NULL
) ENGINE = MYISAM ;
What could be the cause? It is phpMyAdmin that exports the whole database but it is always the same error in the hikashop_click_view, hikashop_lead_view and hikashop_sale_view tables.
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90711
by nicolas
Replied by nicolas on topic SQL-error when moving database
These are actually not tables but views.
It means that your new database doesn't allow the creation of views. You can either remove these queries or add the authorization for your mysql user to create views. HikaShop will work fine without them.
It means that your new database doesn't allow the creation of views. You can either remove these queries or add the authorization for your mysql user to create views. HikaShop will work fine without them.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90718
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Replied by jansuhr on topic SQL-error when moving database
Well, there is no problem creating those views when installing Hikashop, it is just when I make an export of the database and then I get the error when importing.
Same thing happens if I use Akeba Backup to move the site, when Akeba is restoring it stops with the error saying that it can't create the table xx_hikashop_click_view.
It is a hassle to fix that later.
Jan
Same thing happens if I use Akeba Backup to move the site, when Akeba is restoring it stops with the error saying that it can't create the table xx_hikashop_click_view.
It is a hassle to fix that later.
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90720
by nicolas
Replied by nicolas on topic SQL-error when moving database
You should see with your hosting company/server admin if they can authorize your mysql user to create views.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90721
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Replied by jansuhr on topic SQL-error when moving database
If I look in my Localhost phpMyAdmin the root user has full access and everything granted and Create View is checked.
Wouldn't that mean that I would be able to do this on my Localhost? Because I can't.
Wouldn't that mean that I would be able to do this on my Localhost? Because I can't.
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90984
by nicolas
Replied by nicolas on topic SQL-error when moving database
Maybe you're not using the root account in the configuration of your local website ?
I must say that I didn't use much Akeeba backup so I don't know much about it, but the query that we use to create the view is:
and not
so maybe that's an issue you would like to brought up with Akeeba backup if the problem doesn't come from the user access.
I must say that I didn't use much Akeeba backup so I don't know much about it, but the query that we use to create the view is:
Code:
CREATE OR REPLACE VIEW `colorconsult`.`iqej4_hikashop_click_view` AS select `a`.`user_id` AS `user_id`,sum(`b`.`click_partner_price`) AS `click_price` from (`colorconsult`.`iqej4_hikashop_user` `a` left join `colorconsult`.`iqej4_hikashop_click` `b` on(((`a`.`user_id` = `b`.`click_partner_id`) and ((case when (`a`.`user_currency_id` = 0) then 150 else `a`.`user_currency_id` end) = `b`.`click_partner_currency_id`)))) where ((`a`.`user_partner_activated` = 1) and (`b`.`click_partner_paid` = 0)) group by `b`.`click_partner_id`;
and not
Code:
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `colorconsult`.`iqej4_hikashop_click_view` AS select `a`.`user_id` AS `user_id`,sum(`b`.`click_partner_price`) AS `click_price` from (`colorconsult`.`iqej4_hikashop_user` `a` left join `colorconsult`.`iqej4_hikashop_click` `b` on(((`a`.`user_id` = `b`.`click_partner_id`) and ((case when (`a`.`user_currency_id` = 0) then 150 else `a`.`user_currency_id` end) = `b`.`click_partner_currency_id`)))) where ((`a`.`user_partner_activated` = 1) and (`b`.`click_partner_paid` = 0)) group by `b`.`click_partner_id`;
so maybe that's an issue you would like to brought up with Akeeba backup if the problem doesn't come from the user access.
Please Log in or Create an account to join the conversation.
13 years 7 months ago #90989
by jansuhr
Jan Suhr
www.colorconsult.se www.jansuhr.se
Replied by jansuhr on topic SQL-error when moving database
Hi Nicolas,
The code that is faulty is from an export in phpMyAdmin, not Akeeba. But the same thing happens there too.
I just wanted to move over all my sites on my localhost to a new computer. The localhost is an XAMPP installation on Mac.
And I am running as root on my Localhost.
One thing I see is that on a plain Hikashop installation I have on one localhost site, just Joomla and Hikashop, those View are not there. I mean they are not as tables visible in the phpMyadmin for that site. It might be correct?
Jan
The code that is faulty is from an export in phpMyAdmin, not Akeeba. But the same thing happens there too.
I just wanted to move over all my sites on my localhost to a new computer. The localhost is an XAMPP installation on Mac.
And I am running as root on my Localhost.
One thing I see is that on a plain Hikashop installation I have on one localhost site, just Joomla and Hikashop, those View are not there. I mean they are not as tables visible in the phpMyadmin for that site. It might be correct?
Jan
Jan Suhr
www.colorconsult.se www.jansuhr.se
Please Log in or Create an account to join the conversation.
13 years 7 months ago #91143
by nicolas
Replied by nicolas on topic SQL-error when moving database
Hi,
You can simply delete the views via phpmyadmin before doing your backup. As I already said, these views are not necessary to HikaShop functionning. If Hikashop need them (for affiliate calculations), it will attempt to automatically create them.
You can simply delete the views via phpmyadmin before doing your backup. As I already said, these views are not necessary to HikaShop functionning. If Hikashop need them (for affiliate calculations), it will attempt to automatically create them.
Please Log in or Create an account to join the conversation.
13 years 5 months ago #97671
by Huub
Replied by Huub on topic SQL-error when moving database
I ran into the same problem today. Did a backup from the root website and wanted to use it as the setup for a new site in a subfolder.
All went fine except for the hikashop_click_view.
Am i correct in understanding that this table can be removed without further consequences?
What i did now was create the table with this ....
CREATE TABLE IF NOT EXISTS `xxxx_hikashop_click_view` (`order_id` int(10) unsigned NOT NULL DEFAULT '0',`order_number` VARCHAR( 255 ) NOT NULL DEFAULT '') ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
that seemed to work so far.
All went fine except for the hikashop_click_view.
Am i correct in understanding that this table can be removed without further consequences?
What i did now was create the table with this ....
CREATE TABLE IF NOT EXISTS `xxxx_hikashop_click_view` (`order_id` int(10) unsigned NOT NULL DEFAULT '0',`order_number` VARCHAR( 255 ) NOT NULL DEFAULT '') ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
that seemed to work so far.
Please Log in or Create an account to join the conversation.
13 years 5 months ago #97693
by nicolas
Replied by nicolas on topic SQL-error when moving database
Yes you can remove it. It is actually not a table but a view.
Please Log in or Create an account to join the conversation.
Time to create page: 0.266 seconds