自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Liunx環(huán)境下MySQL字符集的修改方法

數(shù)據(jù)庫(kù) MySQL
在使用MySQL數(shù)據(jù)庫(kù)的過(guò)程中,有時(shí)我們需要修改MySQL字符集,下文就教您如何在Liunx下修改MySQL字符集,供您參考學(xué)習(xí)。

MySQL字符集的修改在不同的環(huán)境下有不同的方法,下面為您介紹的是在Liunx環(huán)境下MySQL字符集的修改方法,如果您對(duì)此方面感興趣的話,不妨一看。

Liunx下修改MySQL字符集:

1.查找MySQL的cnf文件的位置

  1. find / -iname '*.cnf' -print  
  2.  
  3. /usr/share/mysql/my-innodb-heavy-4G.cnf  
  4. /usr/share/mysql/my-large.cnf  
  5. /usr/share/mysql/my-small.cnf  
  6. /usr/share/mysql/my-medium.cnf  
  7. /usr/share/mysql/my-huge.cnf  
  8. /usr/share/texmf/web2c/texmf.cnf  
  9. /usr/share/texmf/web2c/mktex.cnf  
  10. /usr/share/texmf/web2c/fmtutil.cnf  
  11. /usr/share/texmf/tex/xmltex/xmltexfmtutil.cnf  
  12. /usr/share/texmf/tex/jadetex/jadefmtutil.cnf  
  13. /usr/share/doc/MySQL-server-community-5.1.22/my-innodb-heavy-4G.cnf  
  14. /usr/share/doc/MySQL-server-community-5.1.22/my-large.cnf  
  15. /usr/share/doc/MySQL-server-community-5.1.22/my-small.cnf  
  16. /usr/share/doc/MySQL-server-community-5.1.22/my-medium.cnf  
  17. /usr/share/doc/MySQL-server-community-5.1.22/my-huge.cnf  

2. 拷貝 small.cnf、my-medium.cnf、my-huge.cnf、my-innodb-heavy-4G.cnf其中的一個(gè)到/etc下,命名為my.cnf

  1. cp /usr/share/mysql/my-medium.cnf /etc/my.cnf 

#p#3. 修改my.cnf

  1. vi /etc/my.cnf 

在[client]下添加

  1. default-character-set=utf8 

在[mysqld]下添加
 

  1. default-character-set=utf8 

4.重新啟動(dòng)MySQL

  1. [root@bogon ~]# /etc/rc.d/init.d/mysql restart  
  2. Shutting down MySQL                                        [ 確定 ]  
  3. Starting MySQL.                                            [ 確定 ]  
  4. [root@bogon ~]# mysql -u root -p  
  5. Enter password:  
  6. Welcome to the MySQL monitor. Commands end with ; or \g.  
  7. Your MySQL connection id is 1  
  8. Server version: 5.1.22-rc-community-log MySQL Community Edition (GPL)  
  9.  
  10. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.  

#p#5.查看MySQL字符集設(shè)置

  1. mysql> show variables like 'collation_%';  
  2. +----------------------+-----------------+  
  3. | Variable_name        | Value           |  
  4. +----------------------+-----------------+  
  5. | collation_connection | utf8_general_ci |  
  6. | collation_database   | utf8_general_ci |  
  7. | collation_server     | utf8_general_ci |  
  8. +----------------------+-----------------+  
  9. 3 rows in set (0.02 sec)  
  10.  
  11. mysql> show variables like 'character_set_%';  
  12. +--------------------------+----------------------------+  
  13. | Variable_name            | Value                      |  
  14. +--------------------------+----------------------------+  
  15. | character_set_client     | utf8                       |  
  16. | character_set_connection | utf8                       |  
  17. | character_set_database   | utf8                       |  
  18. | character_set_filesystem | binary                     |  
  19. | character_set_results    | utf8                       |  
  20. | character_set_server     | utf8                       |  
  21. | character_set_system     | utf8                       |  
  22. | character_sets_dir       | /usr/share/mysql/charsets/ |  
  23. +--------------------------+----------------------------+  
  24. 8 rows in set (0.02 sec)  
  25.  
  26. mysql> 
  27.  

 

 

 

【編輯推薦】

MySQL刪除外鍵定義的方法

MySQL外鍵和參照完整性的聯(lián)系

帶參數(shù)的MySql存儲(chǔ)過(guò)程

PHP中常用到的一些MySQL語(yǔ)句

mysql UPDATE語(yǔ)句的使用方法

責(zé)任編輯:段燃 來(lái)源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-10-14 11:52:38

MySQL字符集

2010-10-09 11:12:32

mysql默認(rèn)字符集

2011-04-11 10:59:33

Oracle字符集

2010-11-24 10:52:57

Mysql字符集

2010-10-09 11:36:30

MySQL字符集

2020-12-16 06:34:16

MySQL字符集服務(wù)器

2021-03-23 18:21:30

MySQL數(shù)據(jù)庫(kù)字符集

2010-06-07 16:09:58

MySQL字符集

2011-04-07 15:58:59

MySQL字符集亂碼

2010-05-06 14:40:59

Oracle字符集

2010-05-06 18:01:07

Oracle Expr

2009-02-24 10:51:30

2010-06-13 16:17:26

MySQL改變字符集

2011-05-16 13:15:55

MySQL存儲(chǔ)字符集

2010-04-13 13:33:37

Oracle字符集

2010-10-09 10:57:22

MySQL默認(rèn)字符集

2010-06-02 17:59:19

MySQL字符集

2010-11-01 15:44:45

DB2字符集

2010-05-17 10:01:09

MySql字符集

2010-04-30 10:16:22

Oracle字符集
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)