Skip to main content
Participant
May 5, 2010
Question

problems loading mysql database from local to remote

  • May 5, 2010
  • 1 reply
  • 666 views

Hi

I wonder if some kind person could help me with my nightmare?

I am using CS3 Dreamweaver.  Probably because I have been trying to sort out this problem for a while, I have gone off in a wrong direction? 

1.  I tried to connect my php form page to a remote database (called: aspainco_busdir) [note: aspainco_ is added as default by the remote server] - with no luck, I got all sorts of errors, so I decided to create a local database via CS3 (called; busdir) in order to test connections.

2. Using XAMPP I successfully created a local server.  The php form page (called: addinfo.php) works beautifully; uploading data to the database.

3. Now I want to upload 'addinfo.php' page and 'busdir' local database, but I can't find any meaningful advice on how to do this.

4. I have successfully uploaded the data from the local 'busdir' database to the remote 'aspainco_busdir' database

5. The directory (which has 'addinfo.php' and the 'connections' directory) has been uploaded.

6.  I have configured the file created by Dreamweaver (connections/busdir.php) as below:

# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_busdir = "localhost";
$database_busdir = "aspainco_busdir";
$username_busdir = "aspainco_busdir";
$password_busdir = "********";
$busdir = mysql_pconnect($hostname_busdir, $database_busdir, $username_busdir, $password_busdir) or trigger_error(mysql_error(),E_USER_ERROR);
?>

7.  When I load 'addinfo.php' in the browser, I get:

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/aspainco/public_html/algorfa/htdocs/sitea/Connections/busdir.php on line 9

Fatal error: Access denied for user 'root'@'localhost' (using password: YES) in /home/aspainco/public_html/algorfa/htdocs/sitea/Connections/busdir.php on line 9

(Line 9 starts: $busdir...)

8.  Looking at the code for 'addinfo.php' I notice it has:

mysql_select_db($database_busdir, $busdir);
  $Result1 = mysql_query($insertSQL, $busdir) or die(mysql_error());
}

mysql_select_db($database_busdir, $busdir);


9.  Do you think : mysql_select_db($database_busdir, $busdir); should be changed to mysql_select_db($database_aspainco_busdir, $aspainco_busdir); ?

10.  Are there other files that I should change?

11. Is there an easier way of doing this?

Some help/direction/advice would be very welcome.  Thanks

This topic has been closed for replies.

1 reply

augustjenAuthor
Participant
May 5, 2010

I am going back to the drawing board!

Will now try to connect to the remote database WITHOUT testing on a local database.

The ftp connection to my site works fine.

But when I try to connect to the database, I get a fail!

I have added my isp to the cpanal/remote mysql.

Again, any ideas please?

augustjenAuthor
Participant
May 5, 2010

Have just received this message from my hosting provider - I guess I am stumped?

Presumably this cannot be done through Dreamweaver?  Although the phpBB forum I have works very well.

You can very well access the web files of your domain through FTP where in the database cannot be connected through the FTP clients since the remote database is restricted in the server for security reason on shared servers however you can very well access your database through the PHPMy admin in your Cpanel. Please try using that to connect to your database and let us know for any further assistance.