<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - Mysql</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=131</link>
    <description>Latest 20 threads of Mysql</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Mon, 25 May 2026 13:54:53 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>phpmyadmin #2002 无法登录 MySQL 服务器</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8732</link>
      <description><![CDATA[在 config.inc.php 中，将

$cfg[\'Servers\'][$i][\'host\'] = \'localhost\';
修改为
$cfg[\'Servers\'][$i][\'host\'] = \'127.0.0.1\';

就解决了。

一个MySQL客户可以两种不同的方式连接mysqld服务器：Unix套接字，它通过在文件系统中的一个文件(缺省“/tmp/mysqld.so ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Wed, 29 Oct 2014 03:30:44 +0000</pubDate>
    </item>
    <item>
      <title>修改及批量某字段的内容</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8003</link>
      <description><![CDATA[修改单行内容：


批量修改：

 
比如：
[mw_shl_code=text,true]UPDATE pre_forum_post SET message = replace(message, \'&amp;#lt;\', \']]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Sat, 14 Sep 2013 05:15:12 +0000</pubDate>
    </item>
    <item>
      <title>user()/session_user() -- 返回当前的用户名和主机名</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7991</link>
      <description><![CDATA[user() 和 session_user() 是同义函数，都返回当前的用户名和主机名，如：]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Wed, 11 Sep 2013 14:42:13 +0000</pubDate>
    </item>
    <item>
      <title>统计一个表中有多少个字段</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7983</link>
      <description><![CDATA[统计一个表中一共有几个字段，可以使用下面两个方法。

方法一：使用 FOUND_ROWS() 函数


方法二：通过查询 information+schema 数据库中的 columns 表


该方法适用于 5.0 版本以上的 MySQL 。]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Sun, 08 Sep 2013 03:29:25 +0000</pubDate>
    </item>
    <item>
      <title>FOUND_ROWS() -- 发现查询缓存中行数</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7982</link>
      <description><![CDATA[FOUND_ROWS() 发现查询缓存中的行数。该函数的应用建立在之前的一个查询上，如下所示：

上面，先用 use 命令切入一个名为 a_table 的数据库，然后用 show tables 命令查询了该数据库中有多少个表，由于表太多，我们不能一行一行的去数，但这个查询已经将结果放入了查询 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Sun, 08 Sep 2013 03:16:39 +0000</pubDate>
    </item>
    <item>
      <title>ord() -- 返回字符串第一个字符的数值</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7980</link>
      <description><![CDATA[ORD() 是个字符串处理函数，它返回字符串的第一个字符（第一个字节）的数值。

如果这个字符对应有 ASCII 值，即它是单个字符，那么直接返回其 ASCII 码值：





用中文来测试：


中文“爱”字的 UTF8 十六进制码为 0xE788B1 ，取第一个字节 0xE7，所以就是十进制的 2 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Sat, 07 Sep 2013 13:43:38 +0000</pubDate>
    </item>
    <item>
      <title>二进制日志</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7648</link>
      <description><![CDATA[MySQL 服务器版本：5.6.10
 
二进制日志文件包含了所有更新了数据或已经潜在更新了数据的所有语句（增加，删除，修改）。一个没有匹配任何行的一个 DELETE 语句就是一个“已经潜在更新了的语句”。
 
 
二进制日志还包含关于每个更新数据库语句的执行时间信息，它不包含 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Mon, 11 Mar 2013 14:30:08 +0000</pubDate>
    </item>
    <item>
      <title>Mysql 客户端命令讲解</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7644</link>
      <description><![CDATA[在登录到 mysql 服务器后，输入 help 或者 ? 就会列出所有的客户端命令( 如果要列出服务器端的帮助那么输入 help contents )：

下面讲解这些命令的使用。

1 . help(\\h) 和 ?
这两个命令就是列出上述的命令列表。

2.&#160;&#160;clear (\\c)
该命令清除当前的命令输入 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Wed, 06 Mar 2013 15:45:30 +0000</pubDate>
    </item>
    <item>
      <title>使用 mysqld_multi 启动多个服务器实例</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7642</link>
      <description><![CDATA[mysql_multi 可以管理多个 mysqld 进程，这些服务进程在不同的 Unix socket 文件和 TCP/IP 端口上监听，并且可以启动/停止服务器，或报告它们的当前状态。

下面以实际操作来演示如何使用 mysqld_multi 脚本及相关文件的配置。

1. 先检查 mysqld 是否在运行，如果在运 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Tue, 05 Mar 2013 16:37:48 +0000</pubDate>
    </item>
    <item>
      <title>A mysqld process already exists</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7641</link>
      <description><![CDATA[在执行 mysqld_multi 启动另一个服务器实例时，如果启动无法成功，并且在错误日志里看到“A mysqld process already exists” 这样的错误提示，一般要回头检查 my.cnf 配置文件，查看里面所定义的服务器实例组([mysqldN]) 下是否存在不同的组有相同的定义之情况。比如将 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Tue, 05 Mar 2013 15:34:29 +0000</pubDate>
    </item>
    <item>
      <title>The host &#39;xxx&#39; could not be looked up with path/bin/resolveip.</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7640</link>
      <description><![CDATA[比如在用 mysql_install_db 来初始化一个数据库时可能会碰到如：

这样的警告。

解决办法很简单，就是将 centos.localdomain 这个主机名定义到 /etc/hosts 文件中，比如：]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Tue, 05 Mar 2013 14:05:17 +0000</pubDate>
    </item>
    <item>
      <title>MAX() -- 返回给定列的最大值</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7283</link>
      <description><![CDATA[MAX() 函数是聚 集函数，它返回给定列的最大值。它通常用在指定了一个唯一列的连接中，并与 GROUP BY 字句一起使用。
 
下图数据表中 time 字段是用 UNIX 时间戳表示的时间值：

 
可以利用 MAX() 函数找出最贴近当前查询的一个时间，如：
[mw_shl_code=text,true]SELEC ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Thu, 12 Jul 2012 09:57:14 +0000</pubDate>
    </item>
    <item>
      <title>UNION 与 UNION ALL -- 联合查询</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7265</link>
      <description><![CDATA[UNION 可以将两个或多个 SELECT 查询联合起来，而这些 SELECT 查询可以作用在同一张表上，也可以作用在不同的表上 --- 对于这种情况，要确保两张表具有相同的列数，否则会出现语法错误。

使用 UNION 查询示例一：
[mw_shl_code=text,true]SELECT uid,username FROM pw_ ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Fri, 06 Jul 2012 05:25:30 +0000</pubDate>
    </item>
    <item>
      <title>删除与增加表中的字段</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7264</link>
      <description><![CDATA[对一个表中的字段进行删除和添加是常有的事情。比如现在一个表中的字段有：

 
现在觉得 fff 这个字段是多于的，那么可用下面的语句删除之：



增加与删除表中字段都属于对表的修改，因此都可以 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Fri, 06 Jul 2012 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title>GROUP BY -- 对数据分组</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7263</link>
      <description><![CDATA[GROUP BY 可以用来对查询结果分组。分组的目的就是将具有相同属性的内容归位一类，以方便统计。

以常用的论坛威力，在论坛里可分为版区，版块，子版块，二级子版块等，而实际应用中，一个论坛可能会被站长划分为多个分区，每个分区中有多个子版块，而子版块里可能还分 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Thu, 05 Jul 2012 08:03:15 +0000</pubDate>
    </item>
    <item>
      <title>INNER JOIN -- 取得存在连接关系的两表中的记录</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7261</link>
      <description><![CDATA[INNER JOIN 称为内连接，它可以用来取得两个存在连接关系的表中的记录。下面以 phpwind8.7 论坛程序为例，来看一下比对一下存在连接关系的两个表：
 
pw_members 是会员信息表，它拥有多个会员信息字段，比如 uid, username, password 等，下图之列出一部分字段：

 
 
 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Thu, 05 Jul 2012 06:17:07 +0000</pubDate>
    </item>
    <item>
      <title>SET NAMES 分析详解</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7255</link>
      <description><![CDATA[了解 SET NAMES 之前，需要先了解 3 个和字符集相关的变量：
character_set_client ,  character_set_connection 和 character_set_results 
 实际上，SET NAMES 命令正好是一次性将这 3 个值进行修改，下面会提到。现在查看它们的默认值，可以通过下面的命令：
[mw_shl ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Wed, 04 Jul 2012 09:14:49 +0000</pubDate>
    </item>
    <item>
      <title>查看数据库编码</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7253</link>
      <description><![CDATA[查看数据库使用的默认编码只需要运行 show create database [数据库名] 命令即可，比如：]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Tue, 03 Jul 2012 15:27:31 +0000</pubDate>
    </item>
    <item>
      <title>DISTINCT -- 去除重复行</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7250</link>
      <description><![CDATA[DISTINCT 用来去除重复的记录行。看下面一个表：
 
上表中，几个用户使用了相同的 IP，如果我们不想列出相同的 IP，那么可以：




如果要统计这些不同的 IP 的行数，可以使用下面的命令 ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Mon, 02 Jul 2012 10:26:48 +0000</pubDate>
    </item>
    <item>
      <title>多表查询</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7249</link>
      <description><![CDATA[当需要从多个表中提取数据时，就需要用到多表查询技术。
 
现在假设表 pw_members 有一个字段 username 表示论坛里的用户名，另一个字段 uid 字段表示该用户所对应的 ID 值；而另一个表 pw_memberdata 里的有一个字段 postnum 表示用户所发表的帖子数，此外还有和 pw_me ...]]></description>
      <category>Mysql</category>
      <author>beyes</author>
      <pubDate>Mon, 02 Jul 2012 08:35:36 +0000</pubDate>
    </item>
  </channel>
</rss>