On 7/20/06, Derek Hopkins <derek.hopkins@xxxxxxxxxxxx> 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.
hey, I don't know whether you have created the database "scan_2" or not. If you haven't then do this at the command prompt or terminal type "mysql" it will take you to the mysql prompt. execute this command at the mysql prompt create database scan_2; (don't forget the semi colon at the end of the scan_2) the database is now created. By default there is no password for root ( root is the superuser or administrator in mysql) You can set the password for the root set password for root@localhost=password('yourpassword'); replace "yourpassword" with the password you want to give to the root user. change the values in your configuration file $db_host = "localhost"; $db_user = "root" $db_pass = "yourpassword" $db_name = "scan2"; You can download the mysql-query-browser to work on mysql database or http://www.phpmyadmin.net/ These are GUI through which you can work on mysql database. For more information on mysql go to mysql site www.mysql.com Regards Ankush Grover http://dev.mysql.com/get/Downloads/MySQLAdministrationSuite/mysql-query-browser-1.1.18-1.i386.rpm/from/pick