+ Reply to Thread
Results 1 to 3 of 3

Thread: php - mysql error Fatal error: Access denied for user 'root'@'localhost'

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

    php - mysql error Fatal error: Access denied for user 'root'@'localhost'

    Hi i have set up a php website via dreamweaver with a testing host as local
    Everything works fine local i can test it all the tables of the database appear correctly on my testing server

    Once i upload this i keep getting this error

    Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'DANI'@'localhost' (using password: YES) in /home/u466564495/public_html/Connections/MANI.php on line 9

    Fatal error: Access denied for user 'DANI'@'localhost' (using password: YES) in /home/u466564495/public_html/Connections/MANI.php on line 9

    I have try many things crated different user check password user names
    I try other host, different servers wamp xampp easy php

    but i still get the same error i dont have a clue why
    This is my code

    <?php
    # Type="MYSQL"
    # HTTP="true"
    $hostname_localhost = "localhost";
    $database_localhost = "cdcol";
    $username_localhost = "root";
    $password_localhost = "password";
    $localhost = mysql_pconnect($hostname_localhost, $username_root, $password_password) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>

    i thin used easy php as a testing server and change this to
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_YYY = "127.0.0.1";
    $database_YYY = "information_schema";
    $username_YYY = "FAM0422";
    $password_YYY = "your_password";
    $YYY = mysql_pconnect($hostname_127.0.0.1, $username_FAM0422, $password_your_password) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>


    i am using windows 7 with dreamweaver8 it works fine local just not on remote host.
    i greatly appreciate any ideas and help as i been stuck on this for 4 days lol
    Please Help

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: php - mysql error Fatal error: Access denied for user 'root'@'localhost'

    Did you create the database on your x10 account using cPanel --> MySQL Databases?
    Create the user?
    Attach the user to the database with all privileges?

    The database name should be YYYYY_aaaaa where YYYYY is your cPanel username and aaaaa is the additional name you gave it.
    Same with the user.
    Nothing is always absolutely so.

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: php - mysql error Fatal error: Access denied for user 'root'@'localhost'

    In addition to descalzo's comments:

    If the remote host you refer to is an X10 server, see also the X10 wiki article on MySQL connection errors.

    That's obviously not the code, as the error message refers to the user "DANI@localhost", whereas the username in the code sample is "root", which makes me wonder what other differences there are.

    The mysql extension is outdated and has ben supplanted twice over. Switch to PDO.

    Please use [php], [html] or [code] tags (as appropriate) to separate and format code.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Access denied for user 'user'@'localhost' (using password: YES)
    By elnasiru96 in forum Programming Help
    Replies: 4
    Last Post: 12-01-2010, 09:30 AM
  2. "The mysql error was: Access denied for user ..." message
    By ianspringham in forum Free Hosting
    Replies: 7
    Last Post: 05-24-2010, 12:29 AM
  3. Replies: 17
    Last Post: 04-22-2010, 08:17 PM
  4. Replies: 1
    Last Post: 03-06-2009, 01:58 AM
  5. Replies: 7
    Last Post: 04-02-2008, 02:46 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