日期:2014-05-16  浏览次数:20721 次

ubuntu 10.04 安装 mySql

终端 输入:sudo apt-get install mysql-server

?

很简单,完成。?

?

安装完成,设置 mysql编码。

?

主要配置文件位置:/etc/mysql/my.cnf.
数据库表文件夹:/var/lib/mysql/,相当于Windows下MySQL的date文件夹

登录MySQL,执行编码显示:

show?variables?like?'character%';


+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+

修改MySQL默认数据库的编码
需要编辑my.cnf文件,Windows可以直接用Mysql Server Instance Config Wizard 进行设置

sudo?gedit?/etc/mysql/my.cnf


找到[client]?添加:

default-character-set=utf8?默认字符集为utf8


找到[mysqld]?添加: