Export DB tables via phpMyAdmin in alphabetical order

I have a MySQL database from a Joomla MultiSite installation, where she has a set of tables with different prefixes for each Joomla site. When I export db via phpMyAdmin, it creates an SQL file in which tables are created and populated in alphabetical order. The problem is that tables for subordinate sites depend on tables for the main site, but in alphabetical order their prefixes are ahead of the main site. Thus, the export works fine, but when I try to import, I get an error message after the error and must manually move the sections in the SQL file to make sure that the dependent tables are created / populated first.

So, is it possible to export db via phpMyAdmin with tables in a specific order?

EDIT: Here's the error I get that should clarify things:

Error

SQL query: Documentation

--
-- Dumping data for table `j1_content_rating`
--
-- --------------------------------------------------------
--
-- Table structure for table `j1_core_acl_aro`
--
CREATE ALGORITHM = UNDEFINED DEFINER = `bookings_bpjms`@`localhost` SQL SECURITY DEFINER VIEW `bookings_bpjms`.`j1_core_acl_aro` AS SELECT `bookings_bpjms`.`js0_core_acl_aro`.`id` AS `id` , `bookings_bpjms`.`js0_core_acl_aro`.`section_value` AS `section_value` , `bookings_bpjms`.`js0_core_acl_aro`.`value` AS `value` , `bookings_bpjms`.`js0_core_acl_aro`.`order_value` AS `order_value` , `bookings_bpjms`.`js0_core_acl_aro`.`name` AS `name` , `bookings_bpjms`.`js0_core_acl_aro`.`hidden` AS `hidden`
FROM `bookings_bpjms`.`js0_core_acl_aro` ;

MySQL said: Documentation
#1146 - Table 'bookings_bpjms.js0_core_acl_aro' doesn't exist 

Parts of the js0_ import script come after parts of j1_, and therefore this error occurs. If I edit this file in a text editor (30+ megabytes and every day), I can find the js0_ parts and move them to the beginning, but this is tedious, requires a lot of time and errors.

+3
source share
1 answer

Is there a problem with checking the foreign key (in this case, a SET FOREIGN_KEY_CHECKS=0at the beginning of the file should work), or is the problem simply importing in a live environment?

mysqldump , , ( ), , , , , .

+2

Source: https://habr.com/ru/post/1748685/


All Articles