-1

I am trying to dump mysql database as it would be exported from PhpMyAdmin (PA). I can see that I have an issue with encoding some values. Using MariaDb 10.5

PA output this: 0x00000000000000000000ffffd5065ccc
Output from PA export:

INSERT INTO `sometable` VALUES
(1810, 2418, 1598915781.825139, 1, 'loginFailValidUsername', 'admin', 1, 0x00000000000000000000ffff556a967f, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36'),

When I run mysqldump from ssh terminal like this:

cdate=$(date '+%Y-%m-%d-%H-%M-%S')
mysqldump -u dbusernamehere -p'secretpass' -h localhost --skip-opt mydatabasename > "v8_${cdate}-sitename.sql"

It continas this line instead: \0\0\0\0\0\0\0\0\0\0���\\�
Output from mysqldump:

INSERT INTO `sometable` VALUES
(1810,2418,1598915781.825139,1,'loginFailValidUsername','admin',1,'\0\0\0\0\0\0\0\0\0\0��Uj�','Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36');

--skip-opt

disable the --opt option (disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys).

Using MariaDb 10.5 so it would be utf8mb4 as default I am using MariaDb 10.5 so it would be utf8mb4 as default,
MaraiDB mysqldump Docs

Any idea what is missing?

DevWL
  • 17,345
  • 6
  • 90
  • 86
  • 1
    please edit your question to show (as text, not an image) output of `show create table yourtablename` for the table having the problem, and some sample data that causes the problem? – ysth Aug 20 '21 at 23:10
  • what type of export are you doing in phpmyadmin? – ysth Aug 20 '21 at 23:12
  • @ysth just standard export data and structure. I am only concern about encoding at the moment. – DevWL Aug 20 '21 at 23:23

1 Answers1

0

Solved

I was about to delete this question as I found the answer, but it might help to someone else so:

--hex-blob

was missing from my flags

Now it outputs 0000000000000000000FFFF556A967F:

INSERT INTO `sometable` VALUES
(1810,2418,1598915781.825139,1,'loginFailValidUsername','admin',1,0x00000000000000000000FFFF556A967F,'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36');
DevWL
  • 17,345
  • 6
  • 90
  • 86