copying mySQL database to server

Discussion in 'Mac Programming' started by mark2288, Jul 27, 2008.

  1. mark2288 macrumors regular

    Joined:
    Jan 11, 2006
    #1
    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!
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
  3. mark2288 thread starter macrumors regular

    Joined:
    Jan 11, 2006
    #3
    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!
     
  4. AlmostThere macrumors 6502a

    #4
    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)
     
  5. mark2288 thread starter macrumors regular

    Joined:
    Jan 11, 2006
    #5
    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?
     

Share This Page