Microsoft Windows XP [版本 5.1.2600] //命令行模式下操作
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\reton.ma>d:
D:\>cd D:\Program Files\MySQL\MySQL Server 5.0\bin
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -polcp
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit
Bye
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| book |
| mysql |
| orilore |
| student |
| test |
+--------------------+
6 rows in set (0.00 sec)
mysql> select * from employee;
ERROR 1046 (3D000): No database selected
mysql> use orilore;
Database changed
mysql> select * from employee;
+-----+-----------+-------+---------+
| Id | name | grade | salary |
+-----+-----------+-------+---------+
| 100 | wang | 2 | 4000.00 |
| 101 | sdfds | 1 | 3220.00 |
| 102 | ieuriouer | 2 | 5454.00 |
| 103 | sddf | 1 | 4000.00 |
| 104 | wefer | 2 | 4000.00 |
| 105 | rewq | 2 | 4000.00 |
+-----+-----------+-------+---------+
6 rows in set (0.00 sec)
mysql> delete from employee where id=105;
Query OK, 1 row affected (0.42 sec)
mysql> select * from employee;
+-----+-----------+-------+---------+
| Id | name | grade | salary |
+-----+-----------+-------+---------+
| 100 | wang | 2 | 4000.00 |
| 101 | sdfds | 1 | 3220.00 |
| 102 | ieuriouer | 2 | 5454.00 |
| 103 | sddf | 1 | 4000.00 |
| 104 | wefer | 2 | 4000.00 |
+-----+-----------+-------+---------+
5 rows in set (0.00 sec)
mysql> create database mydb charset=gb2312;
Query OK, 1 row affected (0.42 sec)
mysql> use mydb;
Database changed
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| book |
| mydb |
| mysql |
| orilore |
| student |
| test |
+--------------------+
7 rows in set (0.00 sec)
mysql> show tables;
Empty set (0.00 sec)
mysql> create table student(
-> id int primary key auto_increment,
-> name varchar(20) not null,
-> age int
-> );
Query OK, 0 rows affected (0.48 sec)
mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| student |
+----------------+
1 row in set (0.00 sec)
mysql> insert into student values(100,'wang',20);
Query OK, 1 row affected (0.41 sec)
mysql> select * from studen;
ERROR 1146 (42S02): Table 'mydb.studen' doesn't exist
mysql> select * from student;
+-----+------+------+
| id | name | age |
+-----+------+------+
| 100 | wang | 20 |
+-----+------+------+
1 row in set (0.00 sec)
mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| student |
+----------------+
1 row in set (0.00 sec)
mysql> desc student;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(20) | NO | | NULL | |
| age | int(11) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> descibe student;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'desci
be student' at line 1
mysql> describe student;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(20) | NO | | NULL | |
| age | int(11) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> Bye
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -uroot -p mydb>d:\mydb.dum
p
Enter password: ****
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> drop database mydb;
Query OK, 1 row affected (0.05 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| book |
| mysql |
| orilore |
| student |
| test |
+--------------------+
6 rows in set (0.00 sec)
mysql> create database mydb2 charset=gb2312;
Query OK, 1 row affected (0.45 sec)
mysql> exit
Bye
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -p mydb2<d:\mydb.dump //注意路径
Enter password: ****
D:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -p //注意路径
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| book |
| mydb2 |
| mysql |
| orilore |
| student |
| test |
+--------------------+
7 rows in set (0.00 sec)
mysql> use mydb2;
Database changed
mysql> show tables;
+-----------------+
| Tables_in_mydb2 |
+-----------------+
| student |
+-----------------+
1 row in set (0.00 sec)
mysql> select * from student;
+-----+------+------+
| id | name | age |
+-----+------+------+
| 100 | wang | 20 |
+-----+------+------+
1 row in set (0.00 sec)
mysql>
分享到:
相关推荐
Mysql命令大全MysqMysql命令大全l命令大全
实用的MySQL命令(一般的操作),里面包含了连接MySQL等 还有操作方面的命令
常用mysql命令行命令 1 .mysql的启动与停止 启动MYSQL服务 net start mysql 停止MYSQL服务 net stop mysql 2 . netstat –na | findstr 3306 查看被监听的端口 , findstr 用于查找后面的端口是否存在 3 ....
Mysql命令大全 Mysql命令大全Mysql命令大全
mysql命令大全,连接数据库,备份数据库,各种操作等
MySQL的命令.doc MySQL的命令.docMySQL的命令.doc
MySql经典命令大全及MySql简体中文版参考手册,希望对大家有用,谢谢
MySQL数据库安装图解,新手一看即懂!!!MySQL数据库安装图解,新手一看即懂!
MySQL5.5安装包及安装图解
基本的mysql命令,从建立数据库到简单的操作基本命令都有。
mysql安装图解,图文详解MYSQL下载及安装的详细过程。
MySQL 5.0安装过程详细图解,每个步骤都有的!
mysql 数据库 安装包 32位安装包 有3种安装类型:Typical(典型安装)、Complete(完全安装)和Custom(定制安装)。 Typical(典型安装)安装只安装MySQL服务器、mysql命令行客户端和命令行实用程序。命令行客户端和实用...
mysql命令集锦,mysql基础命令集合,让你快速上手myslq
个人总结的关于mysql的常用操作!非常实用,对于只做开发的人员是完全够了的!
MySQL5.5安装手册及图解包括: MySQL安装手册.pdf及MySQL安装图解.doc
常见mysql命令总结
linux 服务安装mysql命令,步骤绝对详细,一次成功,很适合新手。