Skip to main content
Participant
June 20, 2007
Question

connecting DW8 to remote DB

  • June 20, 2007
  • 3 replies
  • 359 views
Hi,

I was successful make connection on local computer, make some forms to writte date to DB. But when I put web site on web something ging wrong with connection.

This is connection code that succesful work on local machine:


and this is modified connection for internet:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_cooo = "asg-inc.net";
$database_cooo = "asguser";
$username_cooo = "asguser";
$password_cooo = "Formatedab1";
$cooo = mysql_pconnect($hostname_cooo, $username_cooo, $password_cooo) or trigger_error(mysql_error(),E_USER_ERROR);
?>

this code don't work ad I getting this error message:
Warning: mysql_pconnect(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/a/m/a/amalneval/html/Connections/cooo.php on line 9

I was succesful make testing and remote server... how to resolve this problem!?

any tutorial or sample pages will be great... you can send on this email dotshock@gmail.com

tank's a lot and best wishes Benis.

This topic has been closed for replies.

3 replies

Inspiring
June 25, 2007
I use godaddy for an asp site. I inspected the parameteres in the
query viewer area and copied them. I have two connection files, one
for local and one for godaddy.

In asp I have set my Prepared to false rather than the default true
that dw assigns it.
_shock1Author
Participant
June 21, 2007
HI,

thank's for respond. My hosting firm is godaddy.com and there I was find article about database connection and here it is.

<?php
//Sample Database Connection Syntax for PHP and MySQL.

//Connect To Database
$hostname="mysql.secureserver.net";
$username="your_dbusername";
$password="your_dbpassword";
$dbname="your_dbusername";
$usertable="your_tablename";
$yourfield = "your_field";
mysql_connect($hostname,$username, $password);
mysql_select_db($dbname);

?>

There I was see tah database server is "mysql.secureserver.net"... I was try to make direct connection from dreamweaver but getting message "mysql error: #2003"...

Another question is practical use of dreamweaver database tools. For me everything on my local PC work great but when upload files to server getting error message in conncetion.php file. Ok, I change database name and pasword and still getting same message. Do I need to change something else?

Thanks !
Inspiring
June 21, 2007
I would go to the hosting firm and ask the question. They sometimes
change the port, etc and only they can tell you what is correct. Some
hosts provide you with a sample of how to connect also.