Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mark2288

macrumors regular
Original poster
So I'm trying to learn some SQL and I'm trying to copy a sample database to mySQL server and I get this error:

pu108710:~ Mark$ mysql -umysql -pPASSWORD sampleDB < mysqlsamp.sql
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sampledb'

any ideas what i'm doing wrong? thanks in advance for any help!
 
thanks Lee. seems that issue is fixed. now when i do it, i get this error:

pu108710:~ Mark$ mysql -uroot -pPASSWORD DBname < mysqlsamp.sql
ERROR 1049 (42000): Unknown database 'dbname'

ideas? thanks again for the help!
 
Make sure the database exists before trying to connect to it (either create it manually or put it in the script and remove from the command line)
 
went ahead and created the database then copied the sample into it. thanks a lot for the help!

do you any of you know of any good mySQL tutorial sites/books?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.