This is a discussion on Error loading a database within the MySQL Database forums, part of the Database Forums category; I'm getting the following result by attempting to load a database via 'mysql> source C:\Download\PHPexamples\winestore....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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' ================================ |
|
|||
|
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. |
|
|||
|
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 |