Mysql modification code LinuxMacUnix general bitsCN.com
Mysql: Linux/Mac/Unix/General
The myslq configuration file is required to modify the mysql encoding. the file is in/etc/my. cnf, mac users do not have this file by default. you can find any my-*** in the mysql installation directory/support-files -***. copy cnf to/ect!
Recently, I modified the default mysql encoding. according to the method found on the Internet, adding default-character-set = utf8 under [mysqld] will cause Error 2003! Mysql cannot be started at all.
Later, I checked a lot of information and found that the modification should be as follows:
Add default-character-set = utf8 under [client]
Add the following three lines under [mysqld:
Default-storage-engine = INNODB
Character-set-server = utf8
Collation-server = utf8_general_ci
Then restart the service. linux users can run the services mysql restart command.
Mac users use/Library/StartupItems/MySQLCOM restart
BitsCN.com