Page 1 of 1

Difficulty connecting to MySQL - How to give permission?

Posted: Wed Sep 10, 2008 5:38 am
by PuteraSiong
I have installed MySQL through PHPTriad2-2-1 and find difficulty in connecting to MySQL database. When I run php program connet.php
<?php
//contoh koneksi database MySQL
//Meyambung guna mysql_connect
$sambung = mysql_connect("localhost");
//Jika berhasil masuk ke Database maka nilai
//$sambung 1
//jika tak boleh sambung nilai $sambung 0
if ($sambung){
echo ("koneksi berhasil");
} else {
echo ("koneksi tak berhasil");
}
?>
I got the message:
"Warning: Access denied for user 'ODBC'@'localhost' (using password: NO) in c:\apache\htdocs\sku3063\connect.php on line 4".
Please give some advice to overcome this.

Re: Difficulty connecting to MySQL - How to give permission?

Posted: Sun Sep 14, 2008 8:54 am
by josh
setup a user account using the grant syntax (or your hosts control panel), and connect using hte optional username and password params on mysql_connect.