Home > Article > Backend Development > How to solve mac php garbled problem
Solution to mac php garbled code: First create a text file named "my.cnf"; then change the content to "utf8[mysql]default-character-set=utf8"; then place the file Under conf; finally restart the mysql server.
Recommendation: "PHP Tutorial"
The simplest way is:
1. Create a text file named my.cnf
2. Edit the file and change the content to
[mysqld]character-set-server=utf8[mysqldump]default-character-set=utf8[mysql]default-character-set=utf8
3. Place the file in /Applications/MAMP/conf/
4. Restart mysql server
The above is the detailed content of How to solve mac php garbled problem. For more information, please follow other related articles on the PHP Chinese website!