Mysql 常用命令
来源:互联网 发布:如何评价慈禧 知乎 编辑:程序博客网 时间:2024/06/08 09:45
Mysql 常用命令
启动服务
1. windows 服务方式
2. 通过命令行
net start mysqlà启动数据库(其中mysql为service name)
net stop mysqlà关闭数据库
3. 连接数据库
à命令行输入:mysql –u用户名 –p密码 出现welcome信息,表示成功
4. 使用show语句找出在服务器上当前存在什么数据库
à show databases; (注意要有分号结尾)
5. 删除数据库
àdrop database dbname;
àcommit;
6. 创建数据库
àcreate database dbname;
7. 选择要使用的数据库
àuse dbname;
8. 查看现在的数据库中存在哪些表
àshow tables;
9. 创建一个数据表
àcreate table person(
Id varchar(32) not null primary key,
name varchar(20) not null,
Password varchar(20) not null
)
10. 显示表达结构
àdescribe tablename;
11. 向表中加入记录:
àinsert into tablename value(…);
12. 导入.sql文件命令(例如:c:/person.sql)
àuser rex;
àsource c:/person.sql
13. 删除表
àdrop tablename;
14. 删除表中的全部记录
àdelete from tablename;
15. 更新
à
16. 查看服务器的版本号和当前日期
àselect version(),current_date;
àselect version();select now();
17. 使用mysql用作一个简单的计算器
àselect pi();
àselect sin(pi()/4),(4+1);
18. 查看用户:
àselect user();
19. 使用load命令:
àload data local infile ‘c:/rex.txt’ into table person;
- MySQL常用命令
- MySql常用命令
- MySQL常用命令
- mysql常用命令
- mysql常用命令
- mysql常用命令
- Mysql常用命令
- MySQL常用命令
- mysql 常用命令
- MySQL常用命令
- mysql常用命令
- MySql常用命令
- MySQL常用命令
- mysql 常用命令
- mysql常用命令
- mysql常用命令
- mysql 常用命令
- MySQL常用命令
- 绿坝,监控了哪些应用程序?装了绿坝的朋友,使用要小心啊!
- 解决AJAX.NET中的悬停panel在页面加载时闪烁的问题
- 绿坝的自身防护能力如何?密码如何管理的?
- KaixinHelper学习笔记
- 解决Ajax悬停效果,无法遮蔽FLASH的问题.
- Mysql 常用命令
- IBM暑期实习笔试
- 看清卡卡西的真面目
- J2ME自动选择接入点
- IT项目需要外包之理由以及疑解
- 托福考试 字面和实际意思如此大相径庭
- 图像处理-滤波技术
- JFreeChart中文API
- sql server 2005 游标使用小例