Mysql 5.5中怎么設(shè)置數(shù)據(jù)庫參數(shù),針對這個(gè)問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡單易行的方法。
創(chuàng)新互聯(lián)是少有的成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、營銷型企業(yè)網(wǎng)站、成都微信小程序、手機(jī)APP,開發(fā)、制作、設(shè)計(jì)、友情鏈接、推廣優(yōu)化一站式服務(wù)網(wǎng)絡(luò)公司,從2013年成立,堅(jiān)持透明化,價(jià)格低,無套路經(jīng)營理念。讓網(wǎng)頁驚喜每一位訪客多年來深受用戶好評
--全局級別
mysql> show global variables like '%server%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| character_set_server | utf8 |
| collation_server | utf8_general_ci |
| server_id | 1 |
+----------------------+-----------------+
3 rows in set (0.00 sec)
mysql> set global character_set_server=gbk;
Query OK, 0 rows affected (0.10 sec)
mysql> show global variables like '%server%';
+----------------------+----------------+
| Variable_name | Value |
+----------------------+----------------+
| character_set_server | gbk |
| collation_server | gbk_chinese_ci |
| server_id | 1 |
+----------------------+----------------+
3 rows in set (0.01 sec)
也可以使用下面方式來修改
mysql> show global variables like 'character_set_server';
+----------------------+--------+
| Variable_name | Value |
+----------------------+--------+
| character_set_server | latin1 |
+----------------------+--------+
1 row in set (0.00 sec)
mysql> set @@global.character_set_server=gbk;
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like 'character_set_server';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| character_set_server | gbk |
+----------------------+-------+
1 row in set (0.01 sec)
--會(huì)話級別
mysql> set session character_set_server='utf8';
Query OK, 0 rows affected (0.00 sec)
mysql> show global variables like '%server%';
+----------------------+----------------+
| Variable_name | Value |
+----------------------+----------------+
| character_set_server | gbk |
| collation_server | gbk_chinese_ci |
| server_id | 1 |
+----------------------+----------------+
3 rows in set (0.00 sec)
--show variables查詢的是會(huì)話級別的參數(shù)
mysql> show variables like '%server%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| character_set_server | utf8 |
| collation_server | utf8_general_ci |
| server_id | 1 |
+----------------------+-----------------+
3 rows in set (0.00 sec)
mysql> show session variables like '%server%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| character_set_server | utf8 |
| collation_server | utf8_general_ci |
| server_id | 1 |
+----------------------+-----------------+
3 rows in set (0.00 sec)
即使是使用set global命令設(shè)置的參數(shù),在數(shù)據(jù)庫重啟后,相關(guān)的參數(shù)也會(huì)失效;如果想讓參數(shù)永久生效,可以將參數(shù)寫在配置文件里面。
[root@localhost mysql]# vim /etc/my.cnf
# Character set
character_set_server = gbk
collation_server = gbk_bin
關(guān)于Mysql 5.5中怎么設(shè)置數(shù)據(jù)庫參數(shù)問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道了解更多相關(guān)知識。
本文題目:Mysql5.5中怎么設(shè)置數(shù)據(jù)庫參數(shù)-創(chuàng)新互聯(lián)
當(dāng)前地址:http://muchs.cn/article0/idjio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、云服務(wù)器、App開發(fā)、微信小程序、App設(shè)計(jì)、面包屑導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容