Current location: Hot Scripts Forums » Other Discussions » Database » MySQL failed to open file error....


MySQL failed to open file error....

Reply
  #1 (permalink)  
Old 09-06-06, 05:47 PM
Clark_Kent's Avatar
Clark_Kent Clark_Kent is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Question MySQL failed to open file error....

Hi Everyone,

I'm having trouble trying to execute an sql script from the MySQL console. Let's say i have the test.sql script in the following location "C:\scripts\"

So in order to execute the test.sql script in that folder i would type...

Code:
mysql> source C:\scripts\test.sql;

or

mysql> \. C:\scripts\test.sql;
Both should do the same thing. I keep getting an error that states: "Failed to open file 'C:\scripts\test.sql;', error: 2"

The sql in the file is correct, i executed the script manually by typing out the sql into the console and it executes successfully, but when i try executing it via a .sql script i get that error.

Any idea what's wrong?

Thanks for your time,

- CK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-10-07, 07:32 AM
zaphod2003's Avatar
zaphod2003 zaphod2003 is offline
New Member
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Clark_Kent View Post
Hi Everyone,

I'm having trouble trying to execute an sql script from the MySQL console. Let's say i have the test.sql script in the following location "C:\scripts\"

So in order to execute the test.sql script in that folder i would type...

Code:
mysql> source C:\scripts\test.sql;

or

mysql> \. C:\scripts\test.sql;
Both should do the same thing. I keep getting an error that states: "Failed to open file 'C:\scripts\test.sql;', error: 2"

The sql in the file is correct, i executed the script manually by typing out the sql into the console and it executes successfully, but when i try executing it via a .sql script i get that error.

Any idea what's wrong?

Thanks for your time,

- CK
Try the following:

Code:
\. c:/scripts/test.sql;
the '\' character in SQL is a command character so mySQL thinks you're adding extra parameters to your command.

Error 2 simply means it can't find the file.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with my config.php and base path...getting error: failed to open stream: ... shannonw PHP 2 07-07-06 12:38 PM
Error message not getting displayed. sanjeet Windows .NET Programming 0 12-20-05 11:48 AM
ASP upload prob minority ASP 1 06-27-05 09:35 AM
Server open file altafingar ASP.NET 1 10-20-04 01:12 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 05:28 PM


All times are GMT -5. The time now is 07:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.