解決MySQL中文亂碼問題的方法有以下幾種:
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql -u username -p --default-character-set=utf8 database_name
ALTER TABLE table_name MODIFY column_name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci;
通過以上方法,可以有效解決MySQL中文亂碼問題。