mysql 命令使用
mysql 命令学习:
1. mysql -uroot ;
2.mysql -h ip -ubusiusr -pbusiusr newdrmdb;
3.show databases ; //显示所有的数据库 ;
4.show tables ; //显示所有的表 ;
5.set names gbk ; //设置字符集 ;
6.desc tmonthfees201004 ; //显示表结构 ;
7.alter table tcontents change cVersion cVersion varchar(128) null ; //修改mysql表中字段的属性 ;
8. show index from tcontents from newdrmdb;
show index from newdrmdb.tcontents ;
show keys from tcontents ;
show indexes from tcontents ; //查看表的索引 ;
相关文档:
转载请注明作者和出处
http://www.cnlinux.net
一、介绍
========
测试环境:
Server1:ndbd 192.168.0.11
Server2:ndbd 192.168.0.12
Server3:mysqld --ndb-cluster 192.168.0.13 (ndbd_mgm ndbd_mgmd也在本机)
操作系统均为
RH ES3
kernel-2.4.21-9.EL
glibc-2.3.2-95.6
所需软件包:
mysql-max-5.0.22-lin ......
推广地点表promotion_addr字段:name,id
电话报竣表unicom_record字段:date, sheet_id(关联sheet表id)
报单表sheet字段:id,promotion_addr_id(关联promotion_addr表id)
要求统计某个月已报竣各推广地点的推广个数;
SELECT
p.name, count(*)
from
unicom_record AS ur
Left Join sheet AS s ON ur.sheet_id ......
/*查询数据库*/
show databases;
/*创建数据库*/
create database dengheping;
/*使用数据库*/
use dengheping;
/*创建表*/
create table user(id int primary key auto_increment,name char(255));
/*查询表*/
show tables;
/*显示表结构*/
desc user;
/*插入字段*/
alter table user add password varchar(6 ......
自增长类型增加
1.如果dbms是MsSql,则选定表后,database-> edit current dbms-> 出现DBMS properties对话框,选择General页,左侧的树选择SQL 2000-> Profile-> Column-> Extended Attributes 下面的ExtIdentityIncrement是步进 ......