在windows上导入mysql [英] mysql import on windows

查看:87
本文介绍了在windows上导入mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MySQL文件, db.sql 。我试图使用以下方法导入它:

I have a MySQL file, db.sql. I have tried to import it using:

mysql -uroot -p[password] db < db.sql

我得到的是mysql命令列表,或者我收到语法错误。奇怪的是我上周使用过这个文件,据我所知,我也是这样做的。

All I get is a listing of mysql commands, or I get a syntax error. The weird thing is I used this file last week and, as far as I know, I'm doing it the same way.

我创建数据库,然后在命令行输入上面的内容,但它不起作用。我试过在mysql里面,只是在命令行,似乎没有任何工作。

I create the database, then in command line enter the above but it's not working. I've tried being inside mysql and just at command line and nothing seems to be working.

在Windows或MySQL5中,我应该做些什么?我不知道第一次如何工作......

Is there something I should be doing differently in windows or MySQL5? I don't know how the heck I got it to work the first time...

TIA

推荐答案

试试这个:

mysql -u root -p
(prompts for password)
use db;
source db.sql

这篇关于在windows上导入mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆