Execute MySql File ?

Discussion in 'MySQL' started by seokochin, Oct 4, 2008.

  1. #1
    How can I execute MySql database file (.sql) from command prompt in windows ?

    Plz help
     
    seokochin, Oct 4, 2008 IP
  2. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mysql OPTIONS <c:\yourfile.sql
    For OPTIONS you need to fill in your username, password and if needed the database to connect to.

    Have fun.
     
    chisara, Oct 4, 2008 IP
  3. seokochin

    seokochin Banned

    Messages:
    298
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is it like this :

    ???
     
    seokochin, Oct 4, 2008 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    mysql -u root -p

    in that format i suppose
     
    Bohra, Oct 4, 2008 IP
  5. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    chisara, Oct 4, 2008 IP
  6. fireworking

    fireworking Peon

    Messages:
    460
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just use phpmyadmin. Or open up the mysql command box.
     
    fireworking, Oct 4, 2008 IP
  7. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    He did specifically ask for windows command line so I targetted that part.
    Maybe he wanted to automate / script something, then this is the easiest way, or he uses an IIS or Java stack instead of php so phpmyadmin is not even an option.
     
    chisara, Oct 4, 2008 IP
  8. seokochin

    seokochin Banned

    Messages:
    298
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You are correct.

    But what about using MySql GUI ?
     
    seokochin, Oct 4, 2008 IP
  9. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I have not used Mysql GUI myself so I can't give advice about that. I hope somebody else has more experience with that.

    Cheers,
     
    chisara, Oct 5, 2008 IP
  10. thegussey

    thegussey Peon

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    :) but it's easier (and free also) if you used phpmyadmin more than use the command prompt :)
     
    thegussey, Nov 7, 2008 IP
  11. chisara

    chisara Peon

    Messages:
    141
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You suggesting that the free Mysql Client like the free Mysql server costs money, which is not the case the Mysql Client is free.
    Easier for someone using a Java or ASP.Net webserver ? when phpmyadmin requires a php enviroment I think not.
    Phpmyadmin easier to run into runtime limits (cpu time and ram) with phpmyadmin yep that's phpmyadmin
    Phpmyadmin easier to waste time with problems doing large backup/restores yep that's phpmyadmin
    Easier to forget that phpmyadmin is additional attack surface that needs to be protected, yep thats phpmyadmin

    Easier for you not to read seokochin's question specifically asking for commandline advice yep.
     
    chisara, Nov 7, 2008 IP
  12. niceindustry

    niceindustry Guest

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    my sites use accessy data
    is it safe ?
    thanks
     
    niceindustry, Nov 7, 2008 IP