- 论坛徽章:
- 0
|
建立hi.sql文件:
create table hi(name char(10),id char(4));
用root用户登陆数据库:
E:\mysql\bin>mysql -u root -p123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.0.37-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
更改数据库:
mysql> use mysql;
Database changed
运行该脚本文件:
mysql> source hi.sql
Query OK, 0 rows affected (0.08 sec)
查看hi表的结构:
mysql> desc hi;
+-------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+----------+------+-----+---------+-------+
| name | char(10) | YES | | NULL | |
| id | char(4) | YES | | NULL | |
+-------+----------+------+-----+---------+-------+
2 rows in set (0.02 sec)
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44502/showart_370157.html |
|