Home  >  Q&A  >  body text

Error 1115 (42000): Unknown character set: 'utf8mb4'

<p>I have a MySQL dump and I'm trying to restore it using: </p> <pre class="brush:php;toolbar:false;">mysql -u"username" -p"password" --host="127.0.0.1" mysql_db < mysql_db</pre> <p>However, this throws the error: </p> <pre class="brush:php;toolbar:false;">ERROR 1115 (42000) at line 3231: Unknown character set: 'utf8mb4'</pre> <p>This is line 3231-3233: </p> <pre class="brush:php;toolbar:false;">/*!50003 SET character_set_client = utf8mb4 */ ; /*!50003 SET character_set_results = utf8mb4 */ ; /*!50003 SET collation_connection = utf8mb4_general_ci */ ;</pre> <p>I'm using MySQL 5.1.69. How can I resolve this error? </p>
P粉512729862P粉512729862419 days ago419

reply all(2)I'll reply

  • P粉081360775

    P粉0813607752023-08-29 11:02:52

    You can try:

    Open the sql file through a text editor to find and replace all

    utf8mb4 to utf8

    Import again.

    reply
    0
  • P粉547362845

    P粉5473628452023-08-29 10:41:20

    Your version does not support this character set, I believe 5.5.3 introduced it. You should upgrade mysql to the version used to export this file.

    The error is obvious: you set a certain character set in the code, but your version of mysql does not support it and therefore does not know it.

    Based on https://dev.mysql. com/doc/refman/5.5/en/charset-unicode-utf8mb4.html

    So maybe you could set it to utf8, close your eyes and hope, but it depends on your data and I wouldn't recommend it.

    reply
    0
  • Cancelreply