mysql对自增id重新从1排序的两种方法
使用mysql时,通常表中会有一个自增的id字段,但当我们想将表中的数据清空重新添加数据时,希望id重新从1开始计数,用以下两种方法均可:
方法一:
alter table tablename drop column id;
alter table tablename add id mediumint(8) not null primary key auto_increment first;
方法二:
alter table tablename auto_increment=0
相关文档:
mysql tomcat Too many open files in system
1. MySQL:Too many open files in system
来源:http://phorum.study-area.org/index.php?topic=10819.0
※ 引述《jacinth.bbs@bbs.cs.nthu.edu.tw (蟑螂)》之銘言:
> hi各位
> 我的系統主要跑www+php+mysql
> 有不少人在使用
> 這 ......
安装好mysql后,在使用mysq时,出现了如下问题.
java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:327)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at org.gjt.mm.mysql.jdbc2 ......
show variables like 'character%';查看字符编码
--更改字符集
SET character_set_client = utf-8 ;
SET character_set_connection = utf-8 ;
SET character_set_database = utf-8 ;
SET character_set_results = utf-8 ;
SET character_set_server = utf-8 ;
SET collation_connection = utf8 ;
SET colla ......
一直习惯使用小写的SQL保留字,没想到今天居然遇到了麻烦哈!!和谐一下MYSQL啦!
环境:Server version: 5.1.37-1ubuntu5 (Ubuntu)
alter table child_table_name
add constraint constraint_name
foreign key (column_1)
references reference_table_name(reference_column_1);
和
ALTER TABLE child_t ......
Memcached Functions for MYSQL官方主页:
https://launchpad.net/memcached-udfs
两篇基本文章:
http://www.libing.name/2009/02/06/mysql-map-data-to-memcached.html
http://www.libing.name/2008/02/26/mysql-map-memcached.html
安装和验证的SQL语句:
http://hg.tangent.org/memcached_functions_mysql/file/7 ......