易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql alter 语句用法,添加、修改、删除字段等


//主键
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//增加一个新列
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default '0';
//删除列
alter table t2 drop column c;
//重命名列
alter table t1 change a b integer;
//改变列的类型
alter table t1 change b b bigint not null;
alter table infos change list list tinyint not null default '0';
//重命名表
alter table t1 rename t2;
加索引
mysql> alter table tablename change depno depno int(5) not null;
mysql> alter table tablename add index 索引名 (字段名1[,字段名2 …]);
mysql> alter table tablename add index emp_name (name);
加主关键字的索引
mysql> alter table tablename add primary key(id);
加唯一限制条件的索引
mysql> alter table tablename add unique emp_name2(cardnumber);
删除某个索引
mysql>alter table tablename drop index emp_name;
修改表:
增加字段:
mysql> ALTER TABLE table_name ADD field_name field_type;
修改原字段名称及类型:
mysql> ALTER TABLE table_name CHANGE old_field_name new_field_name field_type;
删除字段:
mysql> ALTER TABLE table_name DROP field_name;


相关文档:

IIS+PHP+MySQL配置 南三方


      在网上找了很多IIS+PHP的配置的方法,试过之后很多都不能达到效果。于是总结了大部分的文章后就得出了这样的方法:(本次操作系统以Win2000为例,如果你要改为其它系统就把系统根目录变一下就Ok了)
一、下载必须的程序:
(1) 先到PHP的官方网站下载一个PHP(本文就以PHP 4.4.2为例)。 ......

mysql 乱码问题。

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 ......

C#连接mysql数据库

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MySql ......

关于mysql 的order by rand()

 官方手册上是这么写的:
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{f ......

Windows 下 mysql 备份恢复命令


假设mysql 安装在c:盘,mysql数据库的用户名是root,密码是123456,数据库名是testdb,在d:盘根目录下面存放备份数据库,备份数据库名字为backup20070713.sql(20070713.sql为备份日期)
备份数据库:
mysqldump -uroot -p123456 testdb>d:/backup20070713.sql
恢复数据库:
删除原有数据库,建立数据库,把备份数据 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号