Closed Thread
Results 1 to 3 of 3

Thread: mysql connection

  1. #1
    ambilly30 is offline x10Hosting Member ambilly30 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    2

    mysql connection

    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 vishal; 03-01-2011 at 11:07 AM. Reason: Password removed

  2. #2
    vishal's Avatar
    vishal is offline -::-X10 Guru-::- vishal has a brilliant futurevishal has a brilliant future
    Join Date
    Nov 2009
    Location
    INDIA
    Posts
    5,254

    Re: mysql connection

    DON'T POST PASSWORD IN FORUMS.

    Check whether your db user has all the privileges
    Regards ~ Vishal
    Giving Reputation (at bottom of my post ) is the best way to encourage the person who helped you on forums.

  3. #3
    ambilly30 is offline x10Hosting Member ambilly30 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    2

    Re: mysql connection

    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

Closed Thread

Similar Threads

  1. Mysql no connection
    By olirav61 in forum Free Hosting
    Replies: 3
    Last Post: 03-11-2011, 04:17 AM
  2. MySql Connection??
    By glbl483118 in forum Free Hosting
    Replies: 1
    Last Post: 12-06-2010, 10:52 PM
  3. [c#] Connection to MySQL DB ?
    By cabzx in forum Programming Help
    Replies: 6
    Last Post: 04-25-2008, 05:16 PM
  4. Replies: 9
    Last Post: 01-10-2008, 03:16 AM
  5. Connection to MySQL
    By chorne in forum Free Hosting
    Replies: 2
    Last Post: 11-23-2007, 06:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers