文章插图
#登入C:Program Files (x86)MySQLMySQL Server 5.0bin>mysql -u wu -p
Enter password: **
登入成功后显示如下信息:
Welcome to the MySQL monitor. Commands end with ; or g.
【MySQL常用命令】Your MySQL connection id is 57
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
#查询当前用户mysql> select user();
+--------------+
| user() |
+--------------+
| wu@localhost |
+--------------+
1 row in set (0.00 sec)
#查询所有用户mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| wu | |
| root | % |
| root | localhost |
+------+-----------+
3 rows in set (0.00 sec)
#查询建表语句mysql> show creat table db;
#新建表格create table MyClass1(
id int(4) not null ,
name char(20) not null,
sex int(4) not null default '0',
degree double(16,2));
#增加数据insert into MyClass values(1,'Tom',96,2),(2,'Joan',82,2), (3,'Wang', 96,2);
#查看表结构mysql> desc myclass1;
+--------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| id | int(4) | NO | PRI | 0 | |
| name | char(20) | NO | | | |
| sex | int(4) | NO | | 0 | |
| degree | double(16,2) | YES | | NULL | |
+--------+--------------+------+-----+---------+-------+
4 rows in set
推荐阅读
- 散粉|化妆中常用的散粉,你用对了吗?
- win7怎么通过命令行激活?
- 在复杂条件搜索上,为什么MySQL只能被ES吊打?
- 常用花茶品种有哪些,白茶品种有哪些
- 深度剖析 Linux cp 命令的秘密
- Linux查看硬件信息超强命令sar,以及可视化工具ksar
- 三季红红枫是什么品种,国内景观现阶段常用红枫品种
- 有胃病怎样服用春砂仁,春砂仁有几种常用吃法
- 常用的前端js函数封装,可以直接用
- 为什么 MySQL 不推荐使用 join?