Pontiac_CZ
Pontiac_CZ

Reputation: 624

mysqldump 10.17 creates a dump file with no data while 10.16 works alright

I have MySQL database (version 5.1.49) running on Synology NAS.

On my new PC I have just downloaded mariadb-10.4.12-winx64.zip and I am trying to use its mysqldump.exe to backup a database "events" from my Synology. The command is:

mysqldump.exe --host=10.9.8.5 --user=admin_backup --password=<my password> --result-file=c:\temp\db_dump.sql events

The output file db_dump.sql is always created but it only contains:

-- MariaDB dump 10.17  Distrib 10.4.12-MariaDB, for Win64 (AMD64)
--
-- Host: 10.9.8.5    Database: events
-- ------------------------------------------------------
-- Server version   5.1.49

/*!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 */;

And that's all. It does not return any error on the command line.

OK, so I looked into the old computer and took the mysqldump.exe from there and used that:

-- MySQL dump 10.16  Distrib 10.2.9-MariaDB, for Win64 (AMD64)
--
-- Host: 10.9.8.5    Database: events
-- ------------------------------------------------------
-- Server version   5.1.49

/*!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 utf8 */;
/*!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 */;

--
-- Table structure for table `Cars`
--

DROP TABLE IF EXISTS `Cars`;

and all the data follows...

Is there an error in mysqldump 10.17?

Upvotes: 1

Views: 773

Answers (1)

Andreas M.
Andreas M.

Reputation: 26

Adding the option --default-character-set=utf8 solved the problem for me.

The default was changed in MariaDB 10.3.11, see https://mariadb.com/kb/en/mysqldump/#options -> default-character-set option. @Pontiac_CZ this change is reflected in your post, see SET NAMES utf8[mb4].

I found the solution thanks to mysqldump fails with "Skipping dump data for table 'table1', it has no fields"

Upvotes: 1

Related Questions