The mysql will first to find the configuration file from /etc/my.cnf
so first copy the sample configuration file to the folder /etc/
use below command to do this:
also the rights of this file should be 644.
then modify the file to add below data:
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=INNODB
so first copy the sample configuration file to the folder /etc/
use below command to do this:
sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnfalso the rights of this file should be 644.
then modify the file to add below data:
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
The whole file will show like below:

本文介绍如何设置MySQL配置文件my.cnf。首先通过复制默认样例文件到/etc/目录下,并调整文件权限为644。然后修改配置文件,设置字符集为utf8,并指定默认存储引擎为INNODB。
194

被折叠的 条评论
为什么被折叠?



