I attempt to backup a single table with the following command, but I got an error:
mysqldump -h0 -P9306 -B manticore --tables fictive_slack1
/*!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: 0 Database: manticore
-- ------------------------------------------------------
-- Server version 6.3.8 d17bd2b6b@24112202
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
mysqldump: Error: 'P01: syntax error, unexpected SELECT near 'SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='manticore' AND TABLE_NAME IN ('fictive_slack1'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE, TOTAL_EXTENTS, INITIAL_SIZE ORDER BY LOGFILE_GROUP_NAME'' when trying to dump tablespaces
mysqldump: Couldn't execute 'SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name = 'fictive_slack1'': P01: syntax error, unexpected identifier near 'DATABASE() AND table_name = 'fictive_slack1'' (1064)
When I run simply mysqldump -h0 -P9306 -B manticore, then an another kind of error is shown:
/*!999999\- enable the sandbox mode */
-- MariaDB dump 10.19 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: 0 Database: manticore
-- ------------------------------------------------------
-- Server version 6.3.8 d17bd2b6b@24112202
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
mysqldump: Error: 'P01: syntax error, unexpected SELECT near 'SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ('manticore'))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE, TOTAL_EXTENTS, INITIAL_SIZE ORDER BY LOGFILE_GROUP_NAME'' when trying to dump tablespaces
--
-- Current Database: `manticore`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `manticore`;
USE `manticore`;
mysqldump: Got error: 1064: "P02: syntax error, unexpected identifier near 'LOCK TABLES `aaa` READ /*!32311 LOCAL */,`aaa_audit1` READ /*!32311 LOCAL */,`aaa_cat1` READ /*!32311 LOCAL */,`aaa_note1` READ /*!32311 LOCAL */,`aaa_tag1` READ /*!32311 LOCAL */,`bbb` READ /*!32311 LOCAL */,`bbb_audit1` READ /*!32311 LOCAL */,`bbb_cat1` READ /*!32311 LOCAL */,`bbb_note1` READ /*!32311 LOCAL */,`bbb_tag1` READ /*!32311 LOCAL */,`fictive` READ /*!32311 LOCAL */,`fictive_audit1` READ /*!32311 LOCAL */,`fictive_cat1` READ /*!32311 LOCAL */,`fi.." when using LOCK TABLES
I had a feeling the recent versions of mariadb’s mysqldump may have a thing that manticore doesn’t like, so I tested with mysqldump 5.7.44, and apparently I could backup fictive_slack1 table just fine.