If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySql Dump Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-05, 10:23
Evo Evo is offline
Registered User
 
Join Date: Feb 2005
Posts: 14
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
Reply With Quote
  #2 (permalink)  
Old 02-26-05, 11:15
ManhQuynh ManhQuynh is offline
Registered User
 
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 11:19.
Reply With Quote
  #3 (permalink)  
Old 02-26-05, 11:27
Evo Evo is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 02-26-05, 11:51
jasong jasong is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 02-26-05, 12:01
jasong jasong is offline
Registered User
 
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);
?>
Reply With Quote
  #6 (permalink)  
Old 02-26-05, 12:54
Evo Evo is offline
Registered User
 
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?
Reply With Quote
  #7 (permalink)  
Old 02-26-05, 13:23
jasong jasong is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 02-26-05, 14:08
Evo Evo is offline
Registered User
 
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.
Reply With Quote
  #9 (permalink)  
Old 02-27-05, 21:23
ManhQuynh ManhQuynh is offline
Registered User
 
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
Reply With Quote
  #10 (permalink)  
Old 02-28-05, 06:42
Evo Evo is offline
Registered User
 
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)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On