57,062
社区成员




mysql> drop database bbs1;
Query OK, 1 row affected (0.22 sec)
mysql> \. D:\bbs.sql
Query OK, 1 row affected (0.02 sec)
Database changed
Query OK, 0 rows affected (0.09 sec)
Query OK, 7 rows affected (0.02 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> show tables;
+----------------+
| Tables_in_bbs1 |
+----------------+
| article |
+----------------+
1 row in set (0.02 sec)
mysql> select * from article;
+----+-----+--------+--------------------------------------+
| id | pid | isleaf | cont |
+----+-----+--------+--------------------------------------+
| 0 | -1 | 0 | 我想报考****学院,这个学校怎么样啊? |
| 1 | 0 | 0 | 垃圾,很小一个学校 |
| 2 | 1 | 1 | 你才垃圾,你牛逼啊, 人家好坏也是.... |
| 3 | 0 | 0 | 在,,,还是比较不错的 |
| 4 | 3 | 0 | 说的没错 |
| 5 | 4 | 1 | 我支持 |
| 6 | 4 | 1 | 我也支持 |
+----+-----+--------+--------------------------------------+
7 rows in set (0.00 sec)
mysql> show create table article;
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
| Table | Create Table
|
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
| article | CREATE TABLE `article` (
`id` int(11) NOT NULL,
`pid` int(11) NOT NULL,
`isleaf` int(11) NOT NULL,
`cont` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
1 row in set (0.00 sec)
mysql>
mysql> show create database bbs1;
+----------+---------------------------------------------------------------+
| Database | Create Database |
+----------+---------------------------------------------------------------+
| bbs1 | CREATE DATABASE `bbs1` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+---------------------------------------------------------------+
1 row in set (0.02 sec)
mysql> show create table article;
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
| Table | Create Table
|
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
| article | CREATE TABLE `article` (
`id` int(11) NOT NULL,
`pid` int(11) NOT NULL,
`isleaf` int(11) NOT NULL,
`cont` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+---------+---------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------+
1 row in set (0.03 sec)
mysql>
mysql> source D:/bbs.sql
Query OK, 1 row affected (0.20 sec)
Database changed
Query OK, 0 rows affected (0.89 sec)
Query OK, 7 rows affected (0.13 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> use bbs1;
Database changed
mysql> show tables;
+----------------+
| Tables_in_bbs1 |
+----------------+
| article |
+----------------+
1 row in set (0.30 sec)
mysql> select * from article;
+----+-----+--------+--------------------------------------+
| id | pid | isleaf | cont |
+----+-----+--------+--------------------------------------+
| 0 | -1 | 0 | 我想报考****学院,这个学校怎么样啊? |
| 1 | 0 | 0 | 垃圾,很小一个学校 |
| 2 | 1 | 1 | 你才垃圾,你牛逼啊, 人家好坏也是.... |
| 3 | 0 | 0 | 在,,,还是比较不错的 |
| 4 | 3 | 0 | 说的没错 |
| 5 | 4 | 1 | 我支持 |
| 6 | 4 | 1 | 我也支持 |
+----+-----+--------+--------------------------------------+
7 rows in set (0.06 sec)
mysql>
\\也可以啊..一个\是转义嘛..
mysql> source G:\\bbs.sql
Query OK, 1 row affected (0.02 sec)
Database changed
Query OK, 0 rows affected (0.13 sec)
Query OK, 7 rows affected (0.08 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> select * from bbs.article;
+----+-----+--------+--------------------------------------+
| id | pid | isleaf | cont |
+----+-----+--------+--------------------------------------+
| 0 | -1 | 0 | 我想报考****学院,这个学校怎么样啊? |
| 1 | 0 | 0 | 垃圾,很小一个学校 |
| 2 | 1 | 1 | 你才垃圾,你牛逼啊, 人家好坏也是.... |
| 3 | 0 | 0 | 在,,,还是比较不错的 |
| 4 | 3 | 0 | 说的没错 |
| 5 | 4 | 1 | 我支持 |
| 6 | 4 | 1 | 我也支持 |
+----+-----+--------+--------------------------------------+
7 rows in set (0.03 sec)
mysql> show full columns from article like 'cont' \G
*************************** 1. row ***************************
Field: cont
Type: text
Collation: latin1_swedish_ci
Null: YES
Key:
Default: NULL
Extra:
Privileges: select,insert,update,references
Comment:
1 row in set (0.00 sec)
mysql>
mysql> show variables like 'character_set%';
+--------------------------+----------+
| Variable_name | Value |
+--------------------------+----------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+----------+
8 rows in set (0.02 sec)
mysql>
mysql> source h:/bbs.sql;
Query OK, 0 rows affected (0.05 sec)
Query OK, 7 rows affected (0.03 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> select * from article;
+----+-----+--------+--------------------------------------+
| id | pid | isleaf | cont |
+----+-----+--------+--------------------------------------+
| 0 | -1 | 0 | 我想报考****学院,这个学校怎么样啊? |
| 1 | 0 | 0 | 垃圾,很小一个学校 |
| 2 | 1 | 1 | 你才垃圾,你牛逼啊, 人家好坏也是.... |
| 3 | 0 | 0 | 在,,,还是比较不错的 |
| 4 | 3 | 0 | 说的没错 |
| 5 | 4 | 1 | 我支持 |
| 6 | 4 | 1 | 我也支持 |
+----+-----+--------+--------------------------------------+
7 rows in set (0.00 sec)
mysql>