mysql_4(解决中文乱码问题)

mysql> create database if not exists xdb default character set utf8;
Query OK, 1 row affected (0.00 sec)

1 先介绍一个ubuntu下mysql的可视化工具

利用命令:sudo apt-get install mysql-Workbench

2 在ubuntu12.04以后如果要设置mysql能够正常显示中文,只需要在文件/etc/mysql/my.cnf

[mysqld]下面添加这行

character-set-server=ut8
然后保存,重启mysql服务:sudo restart mysql

 

INSERT INTO `member` VALUES (1,'james','john','s','1972-01-01',60,'1'),(2,'bush','pack','s','1979-09-01',60,'1'),(3,'hacker','johner','s','1952-11-01',100,'0'),(4,'busher','packer','s','1962-01-01',0,'1'),(5,'hash','newer','n','1922-05-01',60,'1'),(6,'z','y','','1962-03-01',60,'0'),(7,'g','g','','1962-04-01',60,'0'),(8,'y','y','','1962-05-01',60,'0'),(9,'??','?','s','1962-07-01',60,'0');

posted @ 2015-11-08 12:02  PKICA  阅读(265)  评论(0编辑  收藏  举报