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)

  • 相关阅读:
    系统重启
    Linux驱动程序开发
    Linux 下实现控制屏幕显示信息和光标的状态
    Linux C 语言 获取系统时间信息
    linux 获取系统屏幕分辨率
    Linux下得到显示屏参数的方法
    Linux如何关闭防火墙和查看防火墙的具体情况
    查看Linux下网卡状态或 是否连接(转)
    ArcGIS Engine中正确释放打开资源
    在ArcEngine下实现图层属性过滤的两种方法
  • 原文地址:https://www.cnblogs.com/xaf-dfg/p/3944625.html
Copyright © 2011-2022 走看看