Tried various methods, and finally found the following solution, from https://blog.csdn.net/qq756703833/article/details/37971057
Left-click on the WampServer icon in the tray area, select MySQL--my.ini, and the MySQL configuration file will be opened.
1. In the [client] section, add: default-character-set=utf8;
2. In the [mysqld] paragraph, add: character_set_server=utf8.