How to upload a local database to MySql or online server?

Discussion in 'MySQL' started by driventodespair, Jan 26, 2007.

  1. #1
    Sorry if this is very obvious, but I'm trying to put a database I have, online, so I can have it dynamically linked to a new website I am designing based around a property website - i.e I can design the database to look up fields online, instead of inputting each property manually into each webpage.

    I have a database in excel which has obvious fields like name, address, email, website, etc and I want to know if and how I can directly upload this to my web host (I have use of MyPHP and MySQL with my web host) directly without having to manually create a table and fields etc using MySql, and if this is possible, can I create a HTML form (PHP?) to write to and update this database with new additions.

    Any and all useful info/links appreciated, and thank you in advance
     
    driventodespair, Jan 26, 2007 IP
  2. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #2
    If I am right, you wish to use an excel file to fill in a database, including table creation.
    You will have to go by manually creating the table structure, and filling it with category names etc.
    Once you create the table manually, you can then use a simple php script to write/ edit / delete records from the mysql.
    Bye :)
     
    JEET, Jan 26, 2007 IP
  3. driventodespair

    driventodespair Banned

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for that Jeet. So are you saying it would be easier if I had a db (Access) database - would that be easier? And where could I find a script I could customize to suit any uploads?
     
    driventodespair, Jan 26, 2007 IP
  4. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #4
    I was thinking about this. Here's what you can do to make this easier:

    * make the table structure on mysql using phpmyadmin, or php script. (Just a few lines, very easy)

    * Export the excel file as "tab delimited text file" and upload text file to server.
    (File >> Save as...)

    * Now make a php script which reads this text file, and "INSERTS" records to mysql database.
    (Not very difficult again. General php...)

    Things to take care about:

    * When you save the file as text file, long text fields will be saved between (") sign. Before inserting, you must get rid of them.
    You can do this manually, or a replace command in php script also.

    * Make sure to remove any header/footer info you have in excel file. Can also be removed later from the text file. This leaves you with "records" only.


    About the upload script, I am not sure if there are any to upload databases to server. There are ones which help in uploading "big" databases, but they require that the format of both databases be the same. A "dump" created using phpmyadmin to be imported into another mysql database. But I don't think that they convert from "access" to "mysql".

    Bye :)
     
    JEET, Jan 27, 2007 IP
  5. lookzovt

    lookzovt Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can also do the download from db site instead of uploading to web site. If you can have ftp or web server at db location. Maybe you can mount disk from db location to webserver (nfs or windows file sharing)? Then it is easy to read database.
     
    lookzovt, Jan 28, 2007 IP