Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: alext on January 17, 2005, 06:12:25 PM
-
Hello,
I am a newbie to mysql and php and I'm having a little problem connecting to MYSQL on my SME 6.0 server.
I have installed the 3 line fix mentioned in the release notes.
I have written a simple PHP script but the link always comes back as a blank, (indicating a failure?).
The script is as follows:
<?php
$link = mysql_connect('localhost', 'root', '')
?>
<HTML>
<HEAD>
<TITLE></TITLE>
<META name="robots" content="nofollow,noindex">
<META name="keywords" content="">
</HEAD>
<BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080>
MARKER<br>
Link = <?= $link ?><br>
</BODY>
</HTML>
Any help would be appreciated.
Thanks
Alex
-
$link = mysql_connect('localhost', 'root', '')
$link = mysql_connect('localhost', 'USERNAME', 'PASSWORD')
MySQL user root has a LOOOOONG password, you'll find it in /root/my.cnf
Try with that...
Best rgds, Ergin
-
$link = mysql_connect('localhost', 'root', '')
$link = mysql_connect('localhost', 'USERNAME', 'PASSWORD')
MySQL user root has a LOOOOONG password, you'll find it in /root/my.cnf
Try with that...
No. Create a new mysql user, just for this script, with access only to the tables required for this script. Set a password for that user, and use that in this script.