Closed Thread
Results 1 to 4 of 4

Thread: mysql access denied from php

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

    mysql access denied from php

    Hi,
    I found a lot of relevant entries in forum and the wiki and i am still struggling to fix this:

    Link: http://sroshan.x10.bz/v.php

    This is what i am using in my PHP script:

    $db = 'sroshan_temp';
    $host = 'localhost';
    $user = 'sroshan_roshan';
    $pass = 'xxxx';

    $link = mysql_connect($host, $user, $pass);
    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }

    This is what I see on the page:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES) in /home/sroshan/public_html/v.php on line 10
    Could not connect: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES)

  2. #2
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: mysql access denied from php

    Quote Originally Posted by roshn.singh65 View Post
    Hi,
    I found a lot of relevant entries in forum and the wiki and i am still struggling to fix this:

    Link: http://sroshan.x10.bz/v.php

    This is what i am using in my PHP script:

    $db = 'sroshan_temp';
    $host = 'localhost';
    $user = 'sroshan_roshan';
    $pass = 'xxxx';

    $link = mysql_connect($host, $user, $pass);
    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }

    This is what I see on the page:

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES) in /home/sroshan/public_html/v.php on line 10
    Could not connect: Access denied for user 'sroshan_sroshan'@'web4.vital.x10hosting.com' (using password: YES)
    Why the Code details and the error details are not matching?

    In code it says username as sroshan_roshan

    and the error is saying sroshan_sroshan

    Anyway did you created the database and username in cpanel ?
    Did you given permissions to the user?


    Check the procedure --> How to Create a MySQL Database and User
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

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

    Re: mysql access denied from php

    I have two users for the db sroshan_roshan and sroshan_sroshan with all the permissions set as indicated in the link you mentioned.

    I tried creating one more db and user but it did not work out.

  4. #4
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: mysql access denied from php

    Please try now.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

Closed Thread

Similar Threads

  1. mysql access denied
    By chegos in forum Free Hosting
    Replies: 3
    Last Post: 06-10-2010, 07:47 AM
  2. access denied in mysql
    By diaga09 in forum Free Hosting
    Replies: 5
    Last Post: 01-11-2010, 10:04 AM
  3. MySQL access denied...
    By jbdesign in forum Free Hosting
    Replies: 3
    Last Post: 06-01-2009, 11:57 AM
  4. mysql access denied
    By ufclan in forum Free Hosting
    Replies: 6
    Last Post: 02-28-2008, 11:21 PM
  5. Replies: 3
    Last Post: 02-14-2008, 01:38 PM

Tags for this Thread

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