zoukankan      html  css  js  c++  java
  • mysql 客户端调用 远程主机的mysql

    set names utf8;

    SET NAMES显示客户端发送的SQL语句中使用什么字符集。因此,SET NAMES 'cp1251'语句告诉服务器将来从这个客户端传 来的信息采用字符集cp1251”。它还为服务器发送回客户端的结果指定了字符集。(例如,如果你使用一个SELECT语句,它表示列值使用了什么字符 集。)

    下面看看效果:

    mysql> show variables like '%character%';
    +--------------------------+----------------------------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------------------------+
    | character_set_client | gbk |
    | character_set_connection | gbk |
    | character_set_database | gbk |
    | character_set_filesystem | binary |
    | character_set_results | gbk |
    | character_set_server | gbk |
    | character_set_system | utf8 |
    | character_sets_dir | /home/work/lamp/mysql5/share/mysql/charsets/ |
    +--------------------------+----------------------------------------------+
    8 rows in set (0.00 sec)

    mysql> set names utf8;
    Query OK, 0 rows affected (0.00 sec)

    mysql> select * from tbl_flowdis_limit 0,500;
    +----+----------+-------+-----+--------------+
    | id | domain | area | isp | node |
    +----+----------+-------+-----+--------------+
    | 1 | hiphotos | hubei | ct | 西安电信 |
    | 2 | 1111 | hubei | ct | 北京电信 |
    | 3 | skycn | anhui | cnc | 北京联通 |
    +----+----------+-------+-----+--------------+
    3 rows in set (0.00 sec)

    mysql>
    mysql> show variables like '%character%';
    +--------------------------+----------------------------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------------------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | gbk |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | gbk |
    | character_set_system | utf8 |
    | character_sets_dir | /home/work/lamp/mysql5/share/mysql/charsets/ |
    +--------------------------+----------------------------------------------+
    8 rows in set (0.00 sec)

  • 相关阅读:
    BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps 集成SP和Office App
    jQuery 处理TextArea
    Raphael的拖动处理
    CSS的position设置
    SVG的内部事件添加
    SVG的a链接
    SVG的text使用
    SVG的path的使用
    SVG的Transform使用
    Java中两个List对比的算法
  • 原文地址:https://www.cnblogs.com/xaf-dfg/p/3944625.html
Copyright © 2011-2022 走看看