Unix Technical Forum

Error loading a database

This is a discussion on Error loading a database within the MySQL forums, part of the Database Server Software category; --> I'm getting the following result by attempting to load a database via 'mysql> source C:\Download\PHPexamples\winestore.data'. This is the result: ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Error loading a database

I'm getting the following result by attempting to load a database via
'mysql> source C:\Download\PHPexamples\winestore.data'. This is the
result:

ERROR:
Failed to open file 'C:\Download\PHPexamples\winestore.data', error: 2

Any thoughts?

TIA,
David

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:33 AM
Brian Wakem
 
Posts: n/a
Default Re: Error loading a database

davids58@gmail.com wrote:

> I'm getting the following result by attempting to load a database via
> 'mysql> source C:\Download\PHPexamples\winestore.data'. This is the
> result:
>
> ERROR:
> Failed to open file 'C:\Download\PHPexamples\winestore.data', error: 2
>
> Any thoughts?



Error code 2 means the file does not exist.


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Re: Error loading a database

Thanks Brian...I guess windows had failed to update the explorer window
I was looking at and showed the wrong directory name!

In any case, I've moved onto a new error:

ERROR 1044 (42000): Access denied for user 'david'@'127.0.0.1' to
database 'winestore'

FYI, I'm trying to set up MySQL on my machine so I can work with
examples in the O'Reilly book I'm reading. I don't recall any step in
the installation instructions where I had to authorize myself to access
the database.

Thoughts?

Thanks again for your quick responses!
David

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:33 AM
Bill Karwin
 
Posts: n/a
Default Re: Error loading a database

davids58@gmail.com wrote:
> I don't recall any step in
> the installation instructions where I had to authorize myself to access
> the database.


Keep in mind that the MySQL accounts have nothing to do with operating
system logins or passwords that may exist on your system. MySQL
accounts are created when you grant privileges to them.

See the following doc pages for more information:

http://dev.mysql.com/doc/refman/5.0/en/user-names.html
http://dev.mysql.com/doc/refman/5.0/...rivileges.html
http://dev.mysql.com/doc/refman/5.0/...ing-users.html

Regards,
Bill K.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Re: Error loading a database

Bill,

Yes, I understand the distinction bw the OS id/pw and MySQL. I'm not
sure where I gave the impression that I didn't but sorry about that.

I've installed MySQL and configured it (see status listing below). I've
downloaded a database (winestore.data) which is currently at
C:\atmp\winestore.data.

I had added myself (successfully, it seemed) as a user via "GRANT
SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestore.* TO
david@127.0.0.1 IDENTIFIED BY 'secret';". Attempting this now seems to
fail (ERROR 1044 (42000): Access denied for user 'david'@'127.0.0.1' to
database 'winestore').

Any thought you might have re how I can get this database loaded would
be greatly appreciated.

Thanks,
David

============================
mysql> status
--------------
mysql.exe Ver 14.7 Distrib 4.1.9, for Win95/Win98 (i32)

Connection id: 4
Current database:
Current user: david@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.9-max
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3306
Uptime: 12 min 23 sec

Threads: 1 Questions: 23 Slow queries: 0 Opens: 6 Flush tables: 1
Open tables: 0 Queries per second avg: 0.031

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 07:33 AM
Bill Karwin
 
Posts: n/a
Default Re: Error loading a database

davids58@gmail.com wrote:
> Bill,
>
> Yes, I understand the distinction bw the OS id/pw and MySQL. I'm not
> sure where I gave the impression that I didn't but sorry about that.


Sorry, I was making an assumption that you, like so many people, treat
MySQL accounts as the same as OS accounts. My mistake!

> I had added myself (successfully, it seemed) as a user via "GRANT
> SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestore.* TO
> david@127.0.0.1 IDENTIFIED BY 'secret';". Attempting this now seems to
> fail (ERROR 1044 (42000): Access denied for user 'david'@'127.0.0.1' to
> database 'winestore').


> Current user: david@localhost


Well, your current user is david@localhost, whereas you granted
privileges to david@127.0.0.1. Those may not be considered the same as
far as MySQL's privilege tables know. They certainly should be treated
as equivalent, but apparently they aren't.

Also I'm not sure if it's relevant, but when I grant, I put quotes
around both the user and the hostname, for example:

GRANT ... TO 'david'@'localhost' ...

Regards,
Bill K.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Re: Error loading a database

Hmmmmm, well, I attempted to grant priviledges using localhost but it's
still recognizing it as 127.0.0.1.

================================
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestore.*
TO david@localhost IDENTIFIED BY 'secret';
ERROR 1044 (42000): Access denied for user 'david'@'127.0.0.1' to
database 'winestore'
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON winestore.*
TO 'david'@'localhost' IDENTIFIED BY 'secret';
ERROR 1044 (42000): Access denied for user 'david'@'127.0.0.1' to
database 'winestore'
================================

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-28-2008, 07:33 AM
Bill Karwin
 
Posts: n/a
Default Re: Error loading a database

davids58@gmail.com wrote:
> Hmmmmm, well, I attempted to grant priviledges using localhost but it's
> still recognizing it as 127.0.0.1.


Okay, I just tried a grant similar to yours, and it worked fine.

Are you sure there aren't any other records in the db or user tables of
the mysql database corresponding to your 'david' identity? Another
entry may be taking priority.

Regards,
Bill K.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Re: Error loading a database

maybe I should just uninstall EasyPHP and start over again.....

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-28-2008, 07:33 AM
davids58@gmail.com
 
Posts: n/a
Default Re: Error loading a database

I didn't re-install; I just started my attempt this am. Re-reading the
instructions, it seems that I was supposed to start the session using
the root username rather than 'david'. Don't know why it would matter
but it seemed to work just fine under 'root'.

Thanks again for your help!

David

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:08 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com