Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2005
    Posts
    14

    Unanswered: MySql Dump Question

    Ive just built my first website and im trying to link it to a companies database,ive downloaded a Mysqldump file from them,but i dont know what im supposed to do with it and how il actually link my site to thier database,where do i actually place the Mysqldump file?
    I thought the company would offer a little more assistance but unfortunatly they dont,if anybody can give any advice at all it will be greatly appreciated.

    Thanks

    Evo

  2. #2
    Join Date
    Feb 2005
    Location
    Sweden
    Posts
    45
    The purpose with an sqldump is to setup an instance of a database on your own computer or to save it as a backup of the database.

    Linking to another company's database depends on your application and it's as easy as connecting to your own dbserver.

    //M
    Last edited by ManhQuynh; 02-26-05 at 12:19.

  3. #3
    Join Date
    Feb 2005
    Posts
    14
    Thanks for replying ManhQuynh

    Can you recommend any sites that give an explanation on this,like actually linking my site to the database,i have an unused Mysql database in my host package is this where i should place the MySqldump file?
    This is my first attempt at this.

    Evo

  4. #4
    Join Date
    Jul 2004
    Posts
    23
    Well it depends,
    Are you planning on using your new database? This would mean what happens to their database doesnt effect yours.
    Or are you planning to use their database, which would mean both your actions effect the one database.
    SnapSlides.Com - Create slideshows online to share with friends and family.

  5. #5
    Join Date
    Jul 2004
    Posts
    23
    If you are connecting to their database, it would be something like:
    PHP Code:
    <?php
    $dbServer
    ="http://theirsite.etc";
    $dbuserName="username";
    $dbpassword="password";
    $dbName="table_name";
    $con=mysql_connect ($dbServer$dbuserName$dbpassword) or die ('Cannot connect to the database.');
    $db=mysql_select_db ($dbName);
    ?>
    If you are connecting to a database on your server, it would be something like:
    PHP Code:
    <?php
    $dbServer
    ="localhost";
    $dbuserName="username";
    $dbpassword="password";
    $dbName="table_name";
    $con=mysql_connect ($dbServer$dbuserName$dbpassword) or die ('Cannot connect to the database.');
    $db=mysql_select_db ($dbName);
    ?>

  6. #6
    Join Date
    Feb 2005
    Posts
    14
    Thanks for replying jasong

    Well im not sure, not because i cant decide but because of my lack of knowledge,the company with the db havnt supplied a username and password,and it says the following in thier clients area :
    "This file feeds directly into an empty database of your own"
    The above is written in an area where they have 5 different db formats.
    I really am confused as to where i have to put the Mysql dump file.
    My guess is il be using the empty database that i have where my site is hosted,but i dont know if im correct there,is it correct that the MySqldump file would be placed into my empty database,even if that is the case what would i do following that?

  7. #7
    Join Date
    Jul 2004
    Posts
    23
    What you need to do is create a database first and assign a username and password to it.
    If you don't know how, try searching google for how to do that with your control panel, or ask your host.
    Once you've done that, go into phpmyadmin (once again, ask your host, it all depends on what your running) and select the database you just created. Then click on the SQL tab, and paste in the sql dump text.
    Vuala, your done.
    SnapSlides.Com - Create slideshows online to share with friends and family.

  8. #8
    Join Date
    Feb 2005
    Posts
    14
    Until a few hours ago i did have a Mysql empty database and through messing about with things earlier today i accidently deleted the database that my host had given me ( i know,very stupid ) so ive contacted them to try and get my db back and also ive asked them if phpmyadmin is available to me,once they get back to me il try what you have suggested regarding the sql dump text.
    Thanks for taking the time to advise me on this,i appreciate it.

  9. #9
    Join Date
    Feb 2005
    Location
    Sweden
    Posts
    45
    In your case I would translate that the company doesn't want you to connect to their database (the reason you got the sqldump).

    //M

  10. #10
    Join Date
    Feb 2005
    Posts
    14
    Well ive been given an account with them,which they said was for database access,so that i can link my site to thier database,i guess having the sqldump is an indirect way of accessing it(pls correct me if im wrong)

Posting Permissions

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