For me my main goal was to make a stage site for my wordpress site, which had wordfence on it.
I was using plesk obsidian and had to update mariadb to get past the error in the main question here Error (near “ON” at position 25) while importing Table for WORDPRESS ( A foreign key Error)
which I was able to do by reading this blog article - https://support.plesk.com/hc/en-us/articles/213403429-How-to-upgrade-MySQL-5-5-to-5-6-5-7-or-MariaDB-5-5-to-10-0-10-1-10-2-on-Linux-
That took forever but got me passed the above error, but then I was getting this error on db import:
#1062 - Duplicate entry '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xEF\xBF\xBD\xEF\xBF\xBD' for key 'PRIMARY' when find and replace domain on wordfence
I was doing the domain find and replace in vscode "mydomain.com" with "stage.mydomain.com". The problem turned out to be that wordfence saves binary data or something to the database, and just opening it in vscode and saving it was altering that somehow, and thus throwing obscure duplicate entry error for primary key
The fix for the above was to not open, or alter, the .sql file in vscode but to do the find in replace with linux. This was the commands I ran to do this on Mac -
find and replace http: with https: -
perl -pi -w -e 's/http:\/\/mydomain.com/https:\/\/mydomain.com/g;' my_db_file.sql
find and replace mydomain.com with stage.mydomain.com -
perl -pi -w -e 's/mydomain.com/stage.mydomain.com/g;' my_db_file.sql