Home > Database > Mysql Tutorial > linux下的mysql修改默认编码

linux下的mysql修改默认编码

WBOY
Release: 2016-06-07 15:01:26
Original
974 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 安装mysql sudo apt-get install mysql-server 查看mysql默认编码 show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +----

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  安装mysql

  sudo apt-get install mysql-server

  查看mysql默认编码

  show variables like 'character%';

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

  | Variable_name | Value |

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

  | character_set_client | utf8 |

  | character_set_connection | utf8 |

  | character_set_database | latin1 |

  | character_set_filesystem | binary |

  | character_set_results | utf8 |

  | character_set_server | latin1 |

  | character_set_system | utf8 |

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

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

  修改mysql的默认编码

  sudo gedit /etc/mysql/my.cnf

  在[mysqld]

  #

  # * Basic Settings

  #

  下面加上

  character_set_server=utf8

  修改完成后保存然后重启mysql

  sudo /etc/init.d/mysql restart

linux下的mysql修改默认编码

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template