Skip to main content
Participant
April 30, 2012
Answered

MySQL database doesnt work on remote server help!

  • April 30, 2012
  • 3 replies
  • 2534 views

Hi

I am a bit of a PHP/MySQL noob and i am having trouble getting my MySQL database to work on my remote server (it works on my local server).

Locally i have:

Connection Name: local

MySQL server: localhost

User Name: root

Password: root

Database: wbgt

Remotely I have:

Created a database using:

username: wbgt (although it displays it as "web100-wbgt")

password: root

I have also imported the MySQL database on the remote server.

When I try to access any page that uses the MySQL database it comes up blank!

Any Ideas?

Thanks in advance for your help

Eddie

This topic has been closed for replies.
Correct answer edzies

Thanks! I got confused that it wasn't connecting to the remote server.

If anyone else is in a similar situation that i was.

I am using heartinternet.co.uk

  1. export your local MySQL database
  2. create a MySQL database on your remote web hosting provider
  3. go to manage (or something similar) and import the MySQL database on your remote web hosting provider
  4. in dreamweaver go into database panel, +, MySQL connection (or edit your original database)
  5. Connection name - anything you like
  6. MySQL server - Localhost
  7. Username - whatever your remote site named the database in my case i entered admin but the user name is web100-admin-8
  8. Password - your password for your remote database
  9. Database - go into manage your database click databases and on the left hand side you should see the name of your database. in my case it was web100-admin-8 again (I couldnt connect to the remote ddatabase so i had to enter it manually)
  10. Done click put and it should work!

3 replies

Participant
July 31, 2018

What client you are using to connect to mysql database remotely? I would suggest you to use sqlyog or mysql workbench. These tools make the process easier and quick. If you have set up the remote mysql connection correctly, you should be able to connect to the database using either client.

edziesAuthorCorrect answer
Participant
May 1, 2012

Thanks! I got confused that it wasn't connecting to the remote server.

If anyone else is in a similar situation that i was.

I am using heartinternet.co.uk

  1. export your local MySQL database
  2. create a MySQL database on your remote web hosting provider
  3. go to manage (or something similar) and import the MySQL database on your remote web hosting provider
  4. in dreamweaver go into database panel, +, MySQL connection (or edit your original database)
  5. Connection name - anything you like
  6. MySQL server - Localhost
  7. Username - whatever your remote site named the database in my case i entered admin but the user name is web100-admin-8
  8. Password - your password for your remote database
  9. Database - go into manage your database click databases and on the left hand side you should see the name of your database. in my case it was web100-admin-8 again (I couldnt connect to the remote ddatabase so i had to enter it manually)
  10. Done click put and it should work!
sudarshan.t
Inspiring
April 30, 2012
  1. Are you using a db.php or something similar to connect to your MySQL server from your main site?
  2. Are you being able to connect to the remote MySQL server from DW using Connection Test? Does that succeed?
edziesAuthor
Participant
April 30, 2012

Hi Sudarshan

What i have done is:

1 - Created a database and used it on my local server

2 - Created a database on my interent service provider

3  - Exported my local database and imported using phpmyadmin on my web hosting website

When you say dp.php do you mean the connection file, if so mine is local.php:-

<?php

# FileName="Connection_php_mysql.htm"

# Type="MYSQL"

# HTTP="true"

$hostname_local = "localhost";

$database_local = "wbgt";

$username_local = "wbgt";                                   (I changed this from root on my local server to wbgt as my web hosting service wont allow me to put root as a username)

$password_local = "root";

$local = mysql_pconnect($hostname_local, $username_local, $password_local) or trigger_error(mysql_error(),E_USER_ERROR);

?>

I don't know how to connect to the remote server from within dreamweaver or if it is even possible.

Eddie

sudarshan.t
Inspiring
May 1, 2012

There seems to be some error in the connection path of your DB connection script - as you said its working locally but not remotely.

The code you've posted looks like a Dreamweaver generated code.

We're down to 2 options now:

In your 1st post when you say (although it displays username as web100-wbgt), you should probably put that as your username on your remote server to see if it works as most hosts prefix your cPanel username to the DB username. Try if this works.

Else, proceed to Option 2:

In Dreamweaver, define your site with Local & Testing Server info. Window > Databases. This should bring up the Databases panel. Click on the PLUS sign on top and click MySQL Connection. Define your MySQL DB values here and hit Test. See if the test happens successfully. If it does, you're good to go with the same settings. Else, there's something wrong with the credentials you've entered.