How to import mysql innodb with foreign key constraint error?
- font size decrease font size increase font size
- Print Email
To import mysql innodb with foreign key constraint error, follow the steps below:-
- If you have the access to mysql thru terminal, then you can use the command below:-
mysql> SET foreign_key_checks = 0; mysql> SOURCE your_db_dump_file; mysql> SET foreign_key_checks = 1;
- If you import your database thru web interface like phpmyadmin, then you need to edit the sql dump file. Add this to the 1st line of your sql db dump file:-
SET foreign_key_checks = 0;
- then add this line to the last line in your sql db dump file:-
SET foreign_key_checks = 1;
- Now you may import your sql dump file, and it should have no error by now.
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0019 | 412344 | {main}( ) | .../index.php:0 |
2 | 0.0837 | 4262360 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0837 | 4262360 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2957 | 11453280 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2963 | 11477656 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2970 | 11532984 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2972 | 11560384 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3059 | 11960016 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3059 | 11960016 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3161 | 12610720 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3161 | 12610720 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3207 | 12981760 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3243 | 13002128 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4293 | 15802760 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4293 | 15802760 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4327 | 15975696 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in MYSQL
- Read 1208 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0019 | 412344 | {main}( ) | .../index.php:0 |
2 | 0.0837 | 4262360 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0837 | 4262360 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2957 | 11453280 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2963 | 11477656 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2970 | 11532984 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2972 | 11560384 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3059 | 11960016 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3059 | 11960016 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3161 | 12610720 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3161 | 12610720 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3207 | 12981760 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3243 | 13002128 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4293 | 15802760 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4293 | 15802760 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4327 | 15975696 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |