4

We are trying to upgrade our MediaWiki software. According to Manual:Upgrading -> UPGRADE -> Manual:Backing_up_a_wiki, we are supposed to backup the database with:

mysqldump -h hostname -u userid -p --default-character-set=whatever dbname > backup.sql

When we run the command with our parameters and --default-character-set=utf-8:

$ sudo mysqldump -h localhost -u XXX -p YYY --default-character-set=utf-8 ZZZ > 
backup.sql
mysqldump: Character set 'utf-8' is not a compiled character set and is not spec
ified in the '/usr/share/mysql/charsets/Index.xml' file

Checking Index.xml appears to show utf-8 is available. UTF-8 is specifically called out by Manual:$wgDBTableOptions.

$ cat /usr/share/mysql/charsets/Index.xml | grep -B 3 -i 'utf-8'
...
<charset name="utf8">
  <family>Unicode</family>
  <description>UTF-8 Unicode</description>
  <alias>utf-8</alias>
...

We tried both UTF-8 and utf-8 as specified by Manual:$wgDBTableOptions.

I have a couple of questions. First, can we omit --default-character-set since its not working as expected? Second, if we have to use --default-character-set, then what is used to specify UTF-8?


A third, related question is, can we forgo mysqldump all-together by taking the wiki and database offline and then making a physical copy of the database? I am happy to make a copy of the physical database for a restore; and I really don't care much for using tools that cause more trouble than they solve.

If the third item is a viable option, then what is the physical database file that needs to be copied?

1

I had the same problem:

ERROR: Unable to start MySQL server:
mysqld: Character set 'UTF-8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
mysqld: Character set 'UTF-8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

I edited the mysqld.cnf and changed

character-set-server = UTF8

to

character-set-server = utf8mb4
1

In my case It was the same command but I did not need to change the conf file, and the command --default-character-set indeed does work. It is a bug with MySQL, just change "utf-8" to "utf8" or even "utf8mb4" for MySQL.

0

First, can we omit --default-character-set since its not working as expected?

We took the first option and the upgrade proceeded. You mileage may vary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy