lomboz eclipse中如何执行.sql文件?

来源:百度知道 编辑:UC知道 时间:2024/06/14 15:25:18
小弟正学习j2ee,sql文件内容如下:
create database bbs;

use bbs;

create table article
(
id int primary key auto_increment,
pid int,
rootid int,
title varchar(255),
cont text,
pdate datetime,
isleaf int
);

insert into article values (null, 0, 1, '蚂蚁大战大象', '蚂蚁大战大象', now(), 1);
insert into article values (null, 1, 1, '大象被打趴下了', '大象被打趴下了',now(), 1);
insert into article values (null, 2, 1, '蚂蚁也不好过','蚂蚁也不好过', now(), 0);
insert into article values (null, 2, 1, '瞎说', '瞎说', now(), 1);
insert into article values (null, 4, 1, '没有瞎说', '没有瞎说', now(), 0);
insert into article values (null, 1, 1, '怎么可能', '怎么可能', now(), 1);
insert into article values (null, 6, 1, '怎么没有可能', '怎么没有可能', now(), 0);
insert into article values (null, 6, 1, '可能性是很大的', '可能性是很大的', now(), 0);
in

是字符乱码的问题
找到C:\Program Files\MySQL\MySQL Server 5.1下边的my.ini文件
更改第一个default-character-set=gb2312
要是还不好使的话就更改Eclipse的显示的编码为gb2312,再导入就好使

在学习上学堂吧,呵呵

你先把字符的问题改过来试试吧,我就是改过来之后导入就好使了。不行就别在eclipse下导入,用mysql的控制台导入

应该是编码的问题,可以尝试把你的这个文件的编码改一下