mysql connection

Status
Not open for further replies.

ambilly30

New Member
Messages
2
Reaction score
0
Points
0
HI
cannot connect to my sql db vith the following php script
( I have no problem connecting to PHP myAdmin...)
==================================================
<?php
$host = "localhost"; //database location
$user = "ambilly_aymon"; //database username
$pass = "*******"; //database password
$db_name = "ambilly_main"; //database name
//database connection
$link = mysql_pconnect($host, $user, $pass);
mysql_select_db($db_name);
//sets encoding to utf8
mysql_query("SET NAMES utf8");
?>
===========================================
Am i missing something ???
thx
Aymon
 
Last edited by a moderator:

vishal

-::-X10 Guru-::-
Community Support
Messages
5,255
Reaction score
192
Points
63
DON'T POST PASSWORD IN FORUMS.

Check whether your db user has all the privileges
 

ambilly30

New Member
Messages
2
Reaction score
0
Points
0
Hi Vishal

Checked that the account has full privilleges : It has...
If it helps, I tried instaling some CMS from Softaculous (Joomla ) and the installation process of those software failed with DB error ( the install process create the DB and user..)
Below is the error I got from my short script



Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'ambilly_aymon'@'web4.vital.x10hosting.com' (using password: YES) in /home/ambilly/public_html/bd.php on line 7

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ambilly'@'web4.vital.x10hosting.com' (using password: NO) in /home/ambilly/public_html/bd.php on line 8

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/ambilly/public_html/bd.php on line 8

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ambilly'@'web4.vital.x10hosting.com' (using password: NO) in /home/ambilly/public_html/bd.php on line 10

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/ambilly/public_html/bd.php on line 10
 
Status
Not open for further replies.
Top