core 5 php mysql

Mikkel L. Ellertson mikkel at infinity-ltd.com
Thu Jul 20 16:38:42 UTC 2006


Derek Hopkins wrote:
> Hi List
> 
> 	Where can I find the right values to put in this piece of PHP code to
> link to MySQL.  At the moment if Can't Connect
> 
> <?
> $db_host = "localhost";
> $db_user = "mysql";
> $db_pass = "*****";
> $db_name = "scan2";
> 
> $conn = mysql_connect($db_host,$db_user,$db_pass);
> if (!$conn) {
>  echo "Could not connect to MySQL server!";
>  exit;
> }
> 
> I have hid the real value of the PW I think it is   Where can I find the
> values for each field on my system please.         
> 
A couple of points. The first is that you should create a user to
use with the web scripts, and limit the privileges of that user.
Unless you are using something like phpMyAdmin, you probably do not
want the web user to be able to create new users or connections. If
your use does not require it, then do not let the user create or
delete tables/databases. In other words, give the user the minimum
access necessary for the application.

Now, if you have not changed the default configuration, then you
only have one user defined. The default configuration is set for
user root, from the same system as MySQL is running on (localhost)
with no password. You should read the MySQL documentation, or at
least install one of the GUIs for using MySQL. For a web-based
interface, I like phpMyAdmin. You may also want to get MySQL
Administrator.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the users mailing list