Posted on 2011-11-25 23:40
贝贝爸爸 阅读(3882)
评论(3) 编辑 收藏 所属分类:
Linux 、
数据库
$> sudo yum install mysql mysql-server mysql-workbench
# 启动mysql
$> sudo systemctl start mysql.service
# 设置自动启动
$> sudo systemctl enable mysql.service
- 修改默认字符集,修改/etc/my.cnf文件
[mysqladmin]
user=root
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
character-set-server=UTF8
port=3306
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=UTF8
port=3306
socket=/var/lib/mysql/mysql.sock
-
查看默认字符集
mysql> show variables like 'collation_%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)