<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>浮山狼de博客 &#187; mysql</title>
	<atom:link href="https://www.fushanlang.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fushanlang.com</link>
	<description>next station - 下一站，活在当下，且行且思</description>
	<lastBuildDate>Sat, 29 Nov 2014 15:14:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.5</generator>
	<item>
		<title>convert mysql table engine myisam to innodb</title>
		<link>https://www.fushanlang.com/convert-mysql-table-engine-myisam-to-innodb-2331/</link>
		<comments>https://www.fushanlang.com/convert-mysql-table-engine-myisam-to-innodb-2331/#comments</comments>
		<pubDate>Sat, 26 Oct 2013 12:14:57 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2331</guid>
		<description><![CDATA[ #!/bin/bash if [ $# -ne 1 ]; then echo "usage: convert.sh database" exit 1 fi date db=$1 echo "Convert database $db" ; mysql -B -N -e "SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '$db' and engine='myisam'" &#124;awk '{print $1}'&#124; while read table; \ do \ echo "+ Converting Table $table"; \ mysql <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/convert-mysql-table-engine-myisam-to-innodb-2331/">convert mysql table engine myisam to innodb</a></span>]]></description>
				<content:encoded><![CDATA[<pre class="javascript" name="code">

#!/bin/bash
if [ $# -ne 1 ]; then
  echo "usage: convert.sh  database"
  exit 1
fi
date
db=$1
echo  "Convert database $db" ;
mysql -B -N -e "SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES where TABLE_SCHEMA = '$db' and engine='myisam'"  |awk '{print $1}'| while read table; \
do \
     echo "+ Converting Table $table"; \
     mysql -B -N -e "alter table $table engine=innodb" $db; \
done;

</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/convert-mysql-table-engine-myisam-to-innodb-2331/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kill mysql show processlist kill</title>
		<link>https://www.fushanlang.com/kill-mysql-show-processlist-kill-2329/</link>
		<comments>https://www.fushanlang.com/kill-mysql-show-processlist-kill-2329/#comments</comments>
		<pubDate>Sat, 26 Oct 2013 09:07:36 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2329</guid>
		<description><![CDATA[ #!/bin/bash date for id in `mysqladmin processlist &#124; grep -i "your detect filter" &#124;awk '{print $2}'` do mysqladmin kill ${id}; echo ${id}.'\n'; done ]]></description>
				<content:encoded><![CDATA[<pre class="javascript" name="code">
#!/bin/bash
date

for id in `mysqladmin   processlist | grep -i  "your detect filter" |awk '{print $2}'`
do
mysqladmin kill ${id};
echo  ${id}.'\n';
done    
</pre>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/kill-mysql-show-processlist-kill-2329/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS 6.2 install  MySQL-Percona(转)</title>
		<link>https://www.fushanlang.com/centos-6-2-install-mysql-percona-zhuan-2239/</link>
		<comments>https://www.fushanlang.com/centos-6-2-install-mysql-percona-zhuan-2239/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 09:27:51 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[my]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Percona]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2239</guid>
		<description><![CDATA[<p>Mysql 是目前众多企业使用的最频繁的数据，不仅是Mysql有着免费的原因，其还有着在性能上更多的优势，其优势我在这不一一罗列，现就我在安装过程的步骤及其遇到的问题给大家分享一下，权当是自己在此写的一点点心得，若有不足之处请各位大牛们校正</p> <p>1、源码包的装备 可以去http://www.percona.com/downloads/下载你需要的版本 2、安装系统环境准备 可以yum安装相应服务，yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cmake bison Cmake一定要安装，你可以源安装，安装包下载地址在www.cmake.org,也可以yum安装，我图方便直接yum安装了，呵呵 3、数据库安装过程 （1）创建目录，用户和设置权限 mkdir -p /data/mysql #用于存放数据库数据目录 mkdir -p /usr/local/mysql  #用于存放数据库程序文件目录 groupadd mysql                       #添加mysql组 useradd -g mysql mysql -s /sbin/nologin     #添加一个数据库用户且加到mysql组，并设置不作为登陆用户 chown -R mysql.mysql /data/mysql/    #设置数据库目录所属用户及组 （2）编译安装，进入源程序目录 #cd Percona-Server-5.5.15-rel21.0 #cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ <span style="color:#777"> . . . &#8594; Read More: <a href="https://www.fushanlang.com/centos-6-2-install-mysql-percona-zhuan-2239/">CentOS 6.2 install  MySQL-Percona(转)</a></span>]]></description>
				<content:encoded><![CDATA[<p>Mysql 是目前众多企业使用的最频繁的数据，不仅是Mysql有着免费的原因，其还有着在性能上更多的优势，其优势我在这不一一罗列，现就我在安装过程的步骤及其遇到的问题给大家分享一下，权当是自己在此写的一点点心得，若有不足之处请各位大牛们校正</p>
<p>1、源码包的装备<br />
可以去http://www.percona.com/downloads/下载你需要的版本<br />
2、安装系统环境准备<br />
可以yum安装相应服务，yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cmake bison<br />
Cmake一定要安装，你可以源安装，安装包下载地址在www.cmake.org,也可以yum安装，我图方便直接yum安装了，呵呵<br />
3、数据库安装过程<br />
（1）创建目录，用户和设置权限<br />
mkdir -p /data/mysql #用于存放数据库数据目录<br />
mkdir -p /usr/local/mysql  #用于存放数据库程序文件目录<br />
groupadd mysql                       #添加mysql组<br />
useradd -g mysql mysql -s /sbin/nologin     #添加一个数据库用户且加到mysql组，并设置不作为登陆用户<br />
chown -R mysql.mysql /data/mysql/    #设置数据库目录所属用户及组<br />
（2）编译安装，进入源程序目录<br />
#cd Percona-Server-5.5.15-rel21.0<br />
#cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \<br />
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \<br />
-DDEFAULT_CHARSET=utf8 \<br />
-DDEFAULT_COLLATION=utf8_general_ci \<br />
-DWITH_EXTRA_CHARSETS=all \          #若要想使用uft8以外的字符集请将此参数设为all，因为我在此想使用Gbk字符集时，之前用 -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk，在后来配置数据库时死活找不到gbk字符集<br />
-DWITH_MYISAM_STORAGE_ENGINE=1 \<br />
-DWITH_INNOBASE_STORAGE_ENGINE=1 \<br />
-DWITH_MEMORY_STORAGE_ENGINE=1 \<br />
-DWITH_READLINE=1 \<br />
-DENABLED_LOCAL_INFILE=1 \<br />
-DMYSQL_DATADIR=/data/mysql \<br />
-DMYSQL_USER=mysql \<br />
-DMYSQL_TCP_PORT=3307</p>
<p>#make &amp;&amp; make install</p>
<p>(3)拷贝配置文件<br />
#cp support-files/my-medium.cnf /etc/my.cnf     #如果你的机器的内存教大，可以复制My-huge.cnf文件<br />
(4)初始化数据库</p>
<pre>
#/usr/local/mysql/scripts/mysql_install_db  --user=mysql  --basedir=/usr/local/mysql --datadir=/data/mysql/
</pre>
<p>(5)设置开机启动mysql<br />
#cp support-files/mysql.server /etc/init.d/mysql<br />
#chmod 755 /etc/init.d/mysql<br />
#chkconfig mysql on<br />
#echo &#8216;export PATH=/usr/local/mysql/bin:$PATH&#8217; &gt;&gt; /etc/profile        #将mysql的安装路径加入PATH中，方便启动mysql（重启生效）<br />
(6)启动数据库<br />
#service mysql start<br />
(7)检查启动数据库启动正常与否<br />
#ps -ef|grep mysql 如果你看到如下一堆东西就表明数据库正常了<br />
root     39067     1  0 10:47 pts/2    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe &#8211;datadir=/data/mysql &#8211;pid-file=/data/mysql/localhost.pid<br />
mysql    39330 39067  2 10:47 pts/2    00:00:50 /usr/local/mysql/bin/mysqld &#8211;basedir=/usr/local/mysql &#8211;datadir=/data/mysql &#8211;plugin-dir=/usr/local/mysql/lib/plugin &#8212;    user=mysql &#8211;log-error=/data/mysql/localhost.err &#8211;pid-file=/data/mysql/localhost.pid &#8211;socket=/data/mysql/mysql.sock &#8211;port=3307<br />
root     39488  2874  0 11:23 pts/2    00:00:00 grep mysql<br />
4、配置数据库字符集<br />
（1）检查当前数据库字符状态<br />
SHOW VARIABLES LIKE &#8216;%charac%&#8217;<br />
（2）设置数据库字符集为GBK<br />
SET GLOBAL character_set_server=gbk;亦可以直接在配置文件中添加character-set-server = gbk 重启Mysql服务；<br />
(3)设置数据库不区分大小，在my.cnf中添加如下参数<br />
lower_case_table_names = 1<br />
5、一切OK，我们重启数据库服务，开始导入你的数据吧，若有什么不对的地方，还请各位朋友给予校正，谢谢！</p>
<p>本文出自 “<a href="http://starlight.blog.51cto.com">星海一点光</a>” 博客，请务必保留此出处<a href="http://starlight.blog.51cto.com/4440369/1006160">http://starlight.blog.51cto.com/4440369/1006160</a></p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/centos-6-2-install-mysql-percona-zhuan-2239/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql5.5.24无法启动－启动失败</title>
		<link>https://www.fushanlang.com/mysql5-5-24-not-start-failed-to-start-2183/</link>
		<comments>https://www.fushanlang.com/mysql5-5-24-not-start-failed-to-start-2183/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 14:21:10 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=2183</guid>
		<description><![CDATA[<p>mysql 版本升级到5.5据新东家oracle说读写性能较之前的mysql5.1提高了两三倍，所以就在centos vps上安装了mysql5.5.24.</p> <p>rpm安装步骤：</p> <p>到http://dev.mysql.com/downloads/mysql/ 下载对应版本的mysql压缩包，我用的系统是centos 6.2,所以server platform 我选了 Linux Generic  具体下载地址是http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-5.5.24-1.linux2.6.x86_64.tar</p> <p>下载完，解压缩之后 rpm -ivh server.rpm</p> <p>遇到两个问题，一个是mysql 连接遇到错误：“Can&#8217;t connect to local MySQL server through  　/var/lib/mysql/mysql.sock” ，解决方案 touch /var/lib/mysql/mysql.scok ，然后重新启动mysql  ：service mysql start</p> <p>遇到第二个问题：The server quit without updating PID file (/var/lib/mysql/*.pid), 打开mysql错误日志err，看了一下，提示：Mysql-Table &#8216;mysql.host&#8217; doesn&#8217;t exist ，重建mysql数据库表，mysql_install_db &#8211;user=mysql &#8211;ldata=/var/lib/mysql  ，然后</p> <p>/usr/bin/mysqld_safe  发现已经可以安全启动，ctrl+C，然后执行service mysql restart 成功启动mysql5.5.24</p> <p>&#160;</p> ]]></description>
				<content:encoded><![CDATA[<p>mysql 版本升级到5.5据新东家oracle说读写性能较之前的mysql5.1提高了两三倍，所以就在centos vps上安装了mysql5.5.24.</p>
<p>rpm安装步骤：</p>
<p>到<a href="http://dev.mysql.com/downloads/mysql/">http://dev.mysql.com/downloads/mysql/</a> 下载对应版本的mysql压缩包，我用的系统是centos 6.2,所以server platform 我选了 Linux Generic  具体下载地址是<a href="http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-5.5.24-1.linux2.6.x86_64.tar" target="_blank">http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-5.5.24-1.linux2.6.x86_64.tar</a></p>
<p>下载完，解压缩之后 rpm -ivh server.rpm</p>
<p>遇到两个问题，一个是mysql 连接遇到错误：“Can&#8217;t connect to local MySQL server through  　/var/lib/mysql/mysql.sock” ，解决方案 touch /var/lib/mysql/mysql.scok ，然后重新启动mysql  ：service mysql start</p>
<p>遇到第二个问题：The server quit without updating PID file (/var/lib/mysql/*.pid), 打开mysql错误日志err，看了一下，提示：Mysql-Table &#8216;mysql.host&#8217; doesn&#8217;t exist ，重建mysql数据库表，mysql_install_db &#8211;user=mysql &#8211;ldata=/var/lib/mysql  ，然后</p>
<p>/usr/bin/mysqld_safe  发现已经可以安全启动，ctrl+C，然后执行service mysql restart 成功启动mysql5.5.24</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/mysql5-5-24-not-start-failed-to-start-2183/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql(ERROR 1406 (22001): Data too long for column)</title>
		<link>https://www.fushanlang.com/mysql-error-1406-22001-data-too-long-for-column-1828/</link>
		<comments>https://www.fushanlang.com/mysql-error-1406-22001-data-too-long-for-column-1828/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 04:58:03 +0000</pubDate>
		<dc:creator><![CDATA[fushanlang]]></dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.fushanlang.com/blog/?p=1828</guid>
		<description><![CDATA[MySQL 导入恢复数据库错误 <p>执行命令： mysql -u[username] -p[password] dbname&#60;dbbak.sql</p> <p>遇到“ERROR 1406 (22001): Data too long for column at ” 某个字段过长，实际上是数据库sql文件中含有UTF8编码 如中文字段内容在Windows下，命令行窗口不支持UTF-8编码，即便使用“set names utf8;”不会达到转化中文的效果。但是这个问题还是可以解决的： （1）使用默认编码建立数据库。这种情况下就可以直接输入中文了，但是相应的问题，就是会失去UTF-8编码的灵活性。特别是不利于软件的国际化。 （2）放弃命令行窗口登录MySQL，使用图形化客户端。客户端工具可以MySQL的官方网站上找到。（比如navicat，mysql GUI tools之类的软件）</p> <p>实际上sql文件小的话完全可以用phpMyAdmin的导入方式来解决的。对于大文件用上面提到的导入命令，效率比较高。实际上经过尝试，还有第三种解决方案，命令行模式mysql登录到控制台模式，用</p> <p>source命令来导入 sql文件，很奇怪此时就不会再报错了。唯一不爽的是source 命令会输出一行行的sql执行结果，但在无图形化客户端的情况，仍不失为一个好办法，希望对需要的童鞋有用！</p> ]]></description>
				<content:encoded><![CDATA[<h2 id="best-answer-content">MySQL 导入恢复数据库错误</h2>
<p>执行命令：<br />
mysql -u[username] -p[password] dbname&lt;dbbak.sql</p>
<p>遇到<strong>“ERROR 1406 (22001): Data too long for column at ”</strong> 某个字段过长，实际上是数据库sql文件中含有UTF8编码 如中文字段内容在Windows下，命令行窗口不支持UTF-8编码，即便使用“set names utf8;”不会达到转化中文的效果。但是这个问题还是可以解决的：<br />
（1）使用默认编码建立数据库。这种情况下就可以直接输入中文了，但是相应的问题，就是会失去UTF-8编码的灵活性。特别是不利于软件的国际化。<br />
（2）放弃命令行窗口登录MySQL，使用图形化客户端。客户端工具可以MySQL的官方网站上找到。（比如navicat，mysql GUI tools之类的软件）</p>
<p>实际上sql文件小的话完全可以用phpMyAdmin的导入方式来解决的。对于大文件用上面提到的导入命令，效率比较高。实际上经过尝试，还有第三种解决方案，命令行模式mysql登录到控制台模式，用</p>
<p>source命令来导入 sql文件，很奇怪此时就不会再报错了。唯一不爽的是source 命令会输出一行行的sql执行结果，但在无图形化客户端的情况，仍不失为一个好办法，希望对需要的童鞋有用！</p>
]]></content:encoded>
			<wfw:commentRss>https://www.fushanlang.com/mysql-error-1406-22001-data-too-long-for-column-1828/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.657 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2025-10-11 17:34:15 -->
