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

Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置

數(shù)據(jù)庫 MySQL
MySQL數(shù)據(jù)庫是一種開放源代碼的關(guān)系型數(shù)據(jù)庫管理系統(tǒng),MySQL數(shù)據(jù)庫系統(tǒng)使用最常用的數(shù)據(jù)庫管理語言--結(jié)構(gòu)化查詢語言(SQL)進(jìn)行數(shù)據(jù)庫管理。下文中將重點(diǎn)為大家介紹 Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置方法。

Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置:

啟動(dòng)mysql后,以root登錄mysql

isher@isher-ubuntu:~$ mysql -u root

>show variables like 'character%'; #執(zhí)行編碼顯示

+--------------------------+----------------------------+

| 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/ |

+--------------------------+----------------------------+


在某些時(shí)候,我們續(xù)要修改mysql默認(rèn)數(shù)據(jù)庫的編碼,以保證某些遷移的程序可以正常顯示,編輯my.cnf文件進(jìn)行編碼修改,windows可以直接用Mysql Server Instance Config Wizard 進(jìn)行設(shè)置


在linux下修改3個(gè)my.cnf的1個(gè)/etc/mysql/my.cnf文件


找到客戶端配置[client] 在下面添加

default-character-set=utf8 默認(rèn)字符集為utf8

在找到[mysqld] 添加

default-character-set=utf8 默認(rèn)字符集為utf8

init_connect='SET NAMES utf8' (設(shè)定連接mysql數(shù)據(jù)庫時(shí)使用utf8編碼,以讓mysql數(shù)據(jù)庫為utf8運(yùn)行)


修改好后,重新啟動(dòng)mysql 即可,查詢一下show variables like 'character%';

+--------------------------+----------------------------+

| Variable_name | Value |

+--------------------------+----------------------------+

| character_set_client | utf8 |

| character_set_connection | utf8 |

| character_set_database | utf8 |

| character_set_filesystem | binary |

| character_set_results | utf8 |

| character_set_server | utf8 |

| character_set_system | utf8 |

| character_sets_dir | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

此方法用于標(biāo)準(zhǔn)mysql版本同樣有效,對于/etc/my.cnf文件,需要從mysql/support-files的文件夾cp my-large.cnf一份到/etc/my.cnf

對于Ubuntu的用戶,如果是使用 Synaptic 安裝的,則直接在 /etc/mysql/my.cnf

到這里,關(guān)于Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置就已經(jīng)完成了,Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置是數(shù)據(jù)庫操作中經(jīng)常會(huì)用到的一個(gè)操作,希望大家通過本文的學(xué)習(xí)之后能夠掌握Linux系統(tǒng)下的MySQL數(shù)據(jù)庫服務(wù)器字符集設(shè)置方法。

【編輯推薦】

  1. MySQL數(shù)據(jù)庫性能進(jìn)行優(yōu)化三大絕招
  2. MySQL數(shù)據(jù)庫的無縫遷移
  3. 論MySQL數(shù)據(jù)庫中兩種數(shù)據(jù)引擎的差別
  4. MySQL數(shù)據(jù)庫中char與varchar之爭

 

 

責(zé)任編輯:迎迎 來源: 賽迪網(wǎng)
相關(guān)推薦

2011-08-15 21:17:38

Oracle數(shù)據(jù)庫字符集

2010-04-21 09:49:10

Oracle數(shù)據(jù)庫字符

2010-04-13 12:23:34

Oracle數(shù)據(jù)庫

2019-09-10 07:58:01

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

2010-04-13 13:24:04

Oracle數(shù)據(jù)庫

2010-04-23 10:18:42

Oracle數(shù)據(jù)庫字符

2010-10-14 11:52:38

MySQL字符集

2010-05-10 11:50:33

Oracle數(shù)據(jù)庫字符

2011-03-14 13:51:21

LAMPMySQL

2019-05-10 08:27:12

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

2011-05-18 10:36:21

數(shù)據(jù)庫數(shù)據(jù)導(dǎo)入

2010-10-09 10:35:46

MySQL字符集

2011-04-07 15:17:40

MySQL數(shù)據(jù)庫服務(wù)器

2011-03-14 13:51:16

LAMPMySQL

2009-11-20 17:06:49

Oracle數(shù)據(jù)庫字符

2020-12-16 06:34:16

MySQL字符集服務(wù)器

2021-03-23 18:21:30

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

2010-06-07 16:09:58

MySQL字符集

2010-06-10 17:05:28

2023-09-26 15:50:21

點(diǎn)贊
收藏

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