如何在mysql,从文本文件导入数据! mysql youdbname < youpath.txt 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是这样做的:mysql -uroot -pmysql>mysql mydbname < music.sql ;返回有错误! 把你的music.sql 和错误信息贴出来 mysql>mysql jinet_2 < music.sql;error 1064 : you have an error in your sql syntax near 'jinet_2 < music.sql' at line 1 you have an error in your sql syntax near 'jinet_2 < music.sql' at line 1提示给的很清楚的呀.SQL 文件中的语句有句法错误.把那个文件内容前几行帖出来看看. # phpMyAdmin MySQL-Dump# version 2.2.0rc3# http://*******/phpMyAdmin/# http://******/ (******)## Host: localhost# Generation Time: March 6, 2002, 3:19 pm# Server version: 3.23.40# PHP Version: 4.0.6# Database : music2# --------------------------------------------------------## Table structure for table 'area'#CREATE TABLE `area` ( `area_id` int(11) NOT NULL auto_increment, `area_name` varchar(40) NOT NULL default '', PRIMARY KEY (`area_id`)) TYPE=MyISAM;# --------------------------------------------------------## 导出下面的数据库内容 `area`#INSERT INTO area (area_id, area_name) VALUES (1, '港台');INSERT INTO area (area_id, are.......# Table structure for table 'cate'#CREATE TABLE `cate` ( `cate_id` int(11) NOT NULL auto_increment, `cate_name` varchar(40) NOT NULL default '', PRIMARY KEY (`cate_id`)) TYPE=MyISAM;# --------------------------------------------------------## 导出下面的数据库内容 `cate`#INSERT INTO cate (cate_id, cate_name) VALUES (1, '男性歌手');INSERT INTO cate (cate_id, cat.................## Table structure for table 'singer'#CREATE TABLE `singer` ( `singer_id` bigint(100) NOT NULL auto_increment, `alpha` char(1) NOT NULL default '', `singer_name` varchar(40) NOT NULL default '', `cd_num` int(6) NOT NULL def......................## Table structure for table 'user'#CREATE TABLE `user` ( `user_id` bigint(100) NOT NULL auto_increment, `user_name` varchar(40) NOT NULL default '', `passwd` varchar(40) NOT NULL default '', `email` varchar(100) NOT NULL default '', `favorite_cd` tinytext, `favorite_song` tinytext,...............就是这样呀·帮帮忙吧!!! 我的OK了mysql> source f:\bbscs.sqlf:\bbscs.sql是你的那个sql文件我执行了这个,表和数据就都倒进去了 再有就是之前必须mysql>use 你的数据库名称 linux下mysql如何查看back_log大小 我的关注(人,商品,店铺)数据库表怎么设计好点? 谁有mysql workbench方面的资料啊?或者谁能讲解下怎么用啊? SQL查询结果返回重复 SQLYog企业版怎么连接内网mysql数据库? mysql日期插入必须要单引号吗? 如何在我的VC程序中列出PostgreSQL的数据表? 高人指点 求高手 ,树状结构数据怎么插入MYSQL数据库 求助各位大神,我用bugzilla连接mysql,一执行查询mysql就挂了 求救,Linux下 c++程序使用mysql编译出错 关于两个表的查询
# version 2.2.0rc3
# http://*******/phpMyAdmin/
# http://******/ (******)
#
# Host: localhost
# Generation Time: March 6, 2002, 3:19 pm
# Server version: 3.23.40
# PHP Version: 4.0.6
# Database : music2
# --------------------------------------------------------#
# Table structure for table 'area'
#CREATE TABLE `area` (
`area_id` int(11) NOT NULL auto_increment,
`area_name` varchar(40) NOT NULL default '',
PRIMARY KEY (`area_id`)
) TYPE=MyISAM;
# --------------------------------------------------------#
# 导出下面的数据库内容 `area`
#INSERT INTO area (area_id, area_name) VALUES (1, '港台');
INSERT INTO area (area_id, are
.......
# Table structure for table 'cate'
#CREATE TABLE `cate` (
`cate_id` int(11) NOT NULL auto_increment,
`cate_name` varchar(40) NOT NULL default '',
PRIMARY KEY (`cate_id`)
) TYPE=MyISAM;
# --------------------------------------------------------
#
# 导出下面的数据库内容 `cate`
#INSERT INTO cate (cate_id, cate_name) VALUES (1, '男性歌手');
INSERT INTO cate (cate_id, cat.........
........#
# Table structure for table 'singer'
#CREATE TABLE `singer` (
`singer_id` bigint(100) NOT NULL auto_increment,
`alpha` char(1) NOT NULL default '',
`singer_name` varchar(40) NOT NULL default '',
`cd_num` int(6) NOT NULL def.........
.............
#
# Table structure for table 'user'
#CREATE TABLE `user` (
`user_id` bigint(100) NOT NULL auto_increment,
`user_name` varchar(40) NOT NULL default '',
`passwd` varchar(40) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`favorite_cd` tinytext,
`favorite_song` tinytext,...............就是这样呀·
帮帮忙吧!!!
f:\bbscs.sql是你的那个sql文件
我执行了这个,表和数据就都倒进去了