- 博客(0)
- 资源 (2)
- 收藏
- 关注
mysql常用命令大全
services.msc mysql启动服务
mysqldump -hlocalhost -uroot -p6037663 xueshengxinxi>d://xueshengxinxi.sql
mysql中
create database dbname;
use dbname;
source d://所在路径.sql
第一招、mysql服务的启动和停止
net stop mysql
net start mysql
第二招、登陆mysql
语法如下: mysql -u用户名 -p用户密码
键入命令mysql -uroot -p, 回车后提示你输入密码,输入12345,然后回车即可进入到mysql中了,mysql的提示符是:
mysql>
注意,如果是连接到另外的机器上,则需要加入一个参数-h机器IP
第三招、增加新用户
格式:grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"
2017-12-01
oracle 语句
索引与约束
索引
1、如何建立索引
create index 索引名 on 表名(列名)
create index book_bid_idx on book(bid);
create index abc on student(sid,sname);
create index abc1 on student(sname,sid);他们是不同的
2、查看索引
select index_type,index_name,table_name,uniqueness from user_indexes;
select index_name,table_name,column_name,column_position from user_ind_columns;
3、删除索引
drop index 索引名
4、如何查看是否用索引
@d:D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlxplan.sql—创建了索引查询表
explain plan for select ename,job,sal,comm from empcon where (sal-700)<0;--已解释
desc plan_table;
col id for 999
col operation for a16
col option for a16
col object_name for a16
Select id,operation,options,object_name,position from plan_table;
truncate table plan_table;
explain plan for select ename,job,sal from empcon where ename like ‘PRE%’;
Select id,operation,options,object_name,position from plan_table;
2015-06-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人