Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lahore, Pakistan
    Posts
    150
    Thanks
    2
    Thanked 0 Times in 0 Posts

    how to upload mysql database file to any server

    How to upload MYSQL database file(*.sql) to a server . Because my hosting provider does not have a powerful control panel. I just know the username, password and ip address of the server on which i can upload database file.

    plz reply

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    The easiest way would be to create an upload directory, read the file contents and follow the instructions.
    .sql files contain a query on a single line of instruction. file() is a good option to use if you create a temporary file for it. Otherwise, you would need to create an array out of your temporary data by exploding it on each newline.
    From that point, running a query would be a cinch. The trickier part will be to impliment some sort of security and control to it.
    Will this be enough to help, or would you like a quick example?

    Edit:
    Sorry, I lied. It appears not all queries are stored on newlines, create table for instance is on multiple lines.
    I'll look into it a little more for the best route. Worse come to worse, use xml.
    Last edited by Fou-Lu; 06-26-2005 at 03:56 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •