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.
Difficulty connecting to MySQL - How to give permission?
Moderator: General Moderators
-
PuteraSiong
- Forum Newbie
- Posts: 1
- Joined: Wed Sep 10, 2008 5:09 am
Re: Difficulty connecting to MySQL - How to give permission?
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.