Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2011
    Posts
    1

    Unanswered: get data from one databse of other website from current web site web site

    I have details stored in a database of a web site firstweb.com

    I have created another web site secondweb.com

    I want to use data from database of firstweb.com

    Is this possible ...

    Assume : I have all user id and password for both these databases


    If YES, how to do this

    Please help

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Yes it is possible. MySQL is client/server based. When you connect you are prompted for a host, a username, a password and a port number. The port number by default for MySQL is 3306.

    If you are using PHP for your application you would use the following function

    $dbh = mysql_connect("firstweb.com:3306", "username", "password");
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    log on to first database

    run mysqldump to dump the data to an sql file

    log on to second database

    run sql file


    vwalah!!

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Tags for this Thread

Posting Permissions

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