mysql 自增列的创建
1.建表时就创建自增列:
create table test
(
id int auto_increment primary key,
name varchar(20) not null,
password varchar(20) not null
);
insert into test values(null,'aa','aa');
insert into test values(null,'bb','bb');
注意:
插入语句时,自增列的值为NULL。
2、创建表格后添加: alter table table1 add id int auto_increment primary key 自增字段,一定要设置为primary key.
相关文档:
1. 安装mysql的时候选择字符集utf8
2. 安装结束后修改my.ini,有两个地方要修改,
[mysql] default-character-set=gbk
# The default character set that will be used when a new schema or table is
# created and no character set ......
修改MySQL 5.1 data文件夹路径
我安装的这个版本的MYSQL没有data文件夹,但是可以正常使用,不知道你们的有没有呢?怎么才可以出现data文件夹呢,没有data文件夹,那我的数据库文件存放在什么地方了呢?我搜索了整个电脑都没有找到。
好心的朋友,快告诉我怎么回事?该怎么解决?
谢谢了!!!
====================== ......
一、IP信息列表:
名称 IP
LVS-DR-VIP 192.168.50.245
LVS-DR-Master ......
mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’; 权限1,权限2,…权限n代表select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限。当权限1,权限2,…权限n被all privileges或者all代替,表示赋予用户全部 ......
添加字段的格式
ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ...alter_specification: table_option ... | ADD [COLUMN] col_name column_definition [FIRST | AFTER col_name ]
eg.
ALTER TABLE myTbl ADD COLUMN newItem VARCHAR(20) DEFAULT "0" ......