Help - Search - Members - Calendar
Full Version: Connecting to Mysql
The Planet Forums > Control Panels > cPanel/WHM
groupventure
I am attempting to install a supposedly simple php/mysql driven web directory. I have been experienceing dificulty connecting to the mysql data base. I have created it and assigned a user. I suspect somehow I am not entering the user: info properly. Has anyone faced dificulties attempting this process?

<?php
$mysql_hostname = "localhost";
$mysql_user = "ndaqcom_buchen";
$mysql_password = "*******";
$mysql_database = "ndaqcom_ndaq1";
?>
groupventure
QUOTE (groupventure @ Jun 13 2007, 03:51 PM) *
I am attempting to install a supposedly simple php/mysql driven web directory. I have been experienceing dificulty connecting to the mysql data base. I have created it and assigned a user. I suspect somehow I am not entering the user: info properly. Has anyone faced dificulties attempting this process?

<?php
$mysql_hostname = "localhost";
$mysql_user = "ndaqcom_buchen";
$mysql_password = "*******";
$mysql_database = "ndaqcom_ndaq1";
?>


I must have made some unintended changes somewhere. I now am getting a DB: connect failure on an unrelated web site. What have I done?
James Jhurani
QUOTE (groupventure @ Jun 13 2007, 11:38 AM) *
I must have made some unintended changes somewhere. I now am getting a DB: connect failure on an unrelated web site. What have I done?



try and telnet to your server on port 3306, and make sure the port is open.

Also, I am assuming there is more code than what you pasted... because from what you pasted, all I can see is that you defined a few variables, you didn't actually try to open a socket or anything.
groupventure
I just finally got my programmers online. They said the melt down was unrelated to what I had been doing. The Mysql version was updated and the php needed recompiled. Now as for the other bit of code. I am installing directory software and it goes in stages. This is the first stage of testing my connection. I have to set up the config file,/
James Jhurani
Just because you change mysqld versions, doesn't mean you need to recompile php. They are two completely unrelated aspects of your server. The only reason they work together is because we use php to open sockets and connect to the mysqld.

Either way, if it works now, great!

If you are still having problems with the code, just paste us the config (minus the password), and the actual code used to create a socket, and such... That way we will have enough information to identify the cause of the problem.
opensourcedevelopment
Hi,

If possible please use xampp.



opensourcedevelopment.net
Software Development, Support, Maintenance, Web Development
groupventure
I don't know what xamp is.

Here is my config test code.

<?php
require_once("include_install.php");
require_once("config.php");
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $bd);
$sql = mysql_query("SELECT COUNT(*) AS nicks FROM {$prefix}admin");
if($sql){
if(mysql_result($sql,0,"nicks") > 0){
header("Location: {$dir}");
exit();
};
};
?>
HTML
HEAD
TITLE>Install</TITLE
STYLE
BODY {font-family: Arial; font-size: 12px; color: #666666; margin: 5% 12%}
H1 {font-size: 22px; color: #666699; padding-bottom: 10px; border-bottom: 1px solid}
A:link {color: #666699}
A:visited {color: #666699}
A:hover {color: #9999CC}
FORM {margin: 0px}
INPUT {width: 300px; font-family: Arial; font-size: 12px; color: #666666; background: white; padding: 1px 3px 0px; margin-right: 10px}
SELECT {width: 300px; font-family: Arial; font-size: 12px; color: #666666; margin: 1px 0px; margin-right: 10px}
TEXTAREA {width: 300px; height: 70px; font-family: Arial; font-size: 12px; color: #666666; padding: 1px 3px 0px; margin-right: 10px}
P {margin-top: 15px}
.BUTTON {width: auto; background: #dddddd}
</STYLE>
</HEAD>
<BODY>
<H1>Install (step 1)</H1>
Open the file config.php with a text editor and modify the following parameters that will allow the MySQL database connection:<P>
MySQL_Hostname: name of the database server<BR>
MySQL_User: user name<BR>
MySQL_Password: password (if any)<BR>
MySQL_Database: name of the database. Choose the name of an existing database<BR>
Prefix: prefix to database names (optional)<P>
<A HREF="install_2.php"><B>Next &gt;</B></A>
/BODY
/HTML
groupventure
ok, so I did get my connection to work. Now how would I connect to MySQL serverr using a program like dreamweaver?

mysql.ndaq.com? what would it look like?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.