search
HomeDatabaseMysql TutorialLiunx环境下MySQL字符集的修改方法(1)
Liunx环境下MySQL字符集的修改方法(1)Jun 07, 2016 pm 02:52 PM
liunxmysqlRevisecharacter setmethodenvironment

MySQL字符集的修改在不同的环境下有不同的方法,下面为您介绍的是在Liunx环境下MySQL字符集的修改方法,如果您对此方面感兴趣的话,不妨一看。 Liunx下修改MySQL字符集: 1.查找MySQL的cnf文件的位置 find/-iname'*.cnf'-print /usr/share/mysql/my-innodb-h

  MySQL字符集的修改在不同的环境下有不同的方法,下面为您介绍的是在Liunx环境下MySQL字符集的修改方法,如果您对此方面感兴趣的话,不妨一看。

  Liunx下修改MySQL字符集:

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

  find / -iname '*.cnf' -print  
  /usr/share/mysql/my-innodb-heavy-4G.cnf  
  /usr/share/mysql/my-large.cnf  
  /usr/share/mysql/my-small.cnf  
  /usr/share/mysql/my-medium.cnf  
  /usr/share/mysql/my-huge.cnf  
  /usr/share/texmf/web2c/texmf.cnf  
  /usr/share/texmf/web2c/mktex.cnf  
  /usr/share/texmf/web2c/fmtutil.cnf  
  /usr/share/texmf/tex/xmltex/xmltexfmtutil.cnf  
  /usr/share/texmf/tex/jadetex/jadefmtutil.cnf  
  /usr/share/doc/MySQL-server-community-5.1.22/my-innodb-heavy-4G.cnf  
  /usr/share/doc/MySQL-server-community-5.1.22/my-large.cnf  
  /usr/share/doc/MySQL-server-community-5.1.22/my-small.cnf  
  /usr/share/doc/MySQL-server-community-5.1.22/my-medium.cnf  
  /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其中的一个到/etc下,命名为my.cnf

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

  3. 修改my.cnf

  vi /etc/my.cnf 

  在[client]下添加

  default-character-set=utf8

  在[mysqld]下添加
   

  default-character-set=utf8

  4.重新启动MySQL

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

  5.查看MySQL字符集设置

  mysql> show variables like 'collation_%';  
  +----------------------+-----------------+  
  | Variable_name        | Value           |  
  +----------------------+-----------------+  
  | collation_connection | utf8_general_ci |  
  | collation_database   | utf8_general_ci |  
  | collation_server     | utf8_general_ci |  
  +----------------------+-----------------+  
  3 rows in set (0.02 sec)  
  mysql> show variables like 'character_set_%';  
  +--------------------------+----------------------------+  
  | 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/ |  
  +--------------------------+----------------------------+  
  8 rows in set (0.02 sec)  
  mysql>

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
无法引导到Windows恢复环境无法引导到Windows恢复环境Feb 19, 2024 pm 11:12 PM

Windows恢复环境(WinRE)是用于修复Windows操作系统错误的环境。进入WinRE后,您可以执行系统还原、出厂重置、卸载更新等操作。如果无法引导到WinRE,本文将指导您使用修复程序解决此问题。无法引导到Windows恢复环境如果无法引导至Windows恢复环境,请使用下面提供的修复程序:检查Windows恢复环境的状态使用其他方法进入Windows恢复环境您是否意外删除了Windows恢复分区?执行Windows的就地升级或全新安装下面,我们已经详细解释了所有这些修复。1]检查Wi

Python和Anaconda之间有什么区别?Python和Anaconda之间有什么区别?Sep 06, 2023 pm 08:37 PM

在本文中,我们将了解Python和Anaconda之间的差异。Python是什么?Python是一种开源语言,非常重视使代码易于阅读并通过缩进行和提供空白来理解。Python的灵活性和易于使用使其非常适用于各种应用,包括但不限于对于科学计算、人工智能和数据科学,以及创造和发展的在线应用程序。当Python经过测试时,它会立即被翻译转化为机器语言,因为它是一种解释性语言。有些语言,比如C++,需要编译才能被理解。精通Python是一个重要的优势,因为它非常易于理解、开发,执行并读取。这使得Pyth

mysql怎么替换换行符mysql怎么替换换行符Apr 18, 2022 pm 03:14 PM

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

mysql怎么将varchar转换为int类型mysql怎么将varchar转换为int类型May 12, 2022 pm 04:51 PM

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

运维工作十多年,无数个瞬间、我觉得自己还是个小白...运维工作十多年,无数个瞬间、我觉得自己还是个小白...Jun 09, 2023 pm 09:53 PM

​曾几何时,当我还是一名初出茅庐的计算机专业应届生的时候,在招聘网站上浏览了很多招聘贴,眼花缭乱的技术岗位让我摸不着头脑:研发工程师、运维工程师、测试工程师...‍大学期间专业课马马虎虎,更谈不上有什么技术视野,对于具体从事那个技术方向并没有什么明确的想法。直到一位学长对我说:“做运维吧,做运维不用天天写代码,会玩Liunx就行!比做开发轻松多了!”‍‍‍‍‍‍‍‍我选择了相信......入行十多年,吃过很多苦,背了很多锅,弄死过服务器,经历过部门裁员,如果有人现在跟我说做运维比开发简单,那我会

MySQL复制技术之异步复制和半同步复制MySQL复制技术之异步复制和半同步复制Apr 25, 2022 pm 07:21 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

php集成环境包有哪些php集成环境包有哪些Jul 24, 2023 am 09:36 AM

php集成环境包有:1、PhpStorm,功能强大的PHP集成环境;2、Eclipse,开放源代码的集成开发环境;3、Visual Studio Code,轻量级的开源代码编辑器;4、Sublime Text,受欢迎的文本编辑器,广泛用于各种编程语言;5、NetBeans,由Apache软件基金会开发的集成开发环境;6、Zend Studio,为PHP开发者设计的集成开发环境。

带你把MySQL索引吃透了带你把MySQL索引吃透了Apr 22, 2022 am 11:48 AM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software