SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access denied for user

    Hi
    i got this error.i am using wamp server and i hav imported the database but still failed to access this page.please help me in this regard.

    Warning: mysql_query() [function.mysql-query]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\project\admin\login.php on line 17

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\project\admin\login.php on line 17

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    Romania, Iasi
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you supposed to login with user "SYSTEM" and without a password?

  3. #3
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok it is not recommendated settings but if you dont have much idea about these there must be a user called "root" with out any password (come with default wamp installation)
    may be u can use that for now
    and later may be u can change password of root or create a another user
    just for now to move ahead may be you can use root .."" in your localhost testing

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,679
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    WAMP - Argh!

    Oh, well, what you need is the good old GRANT command and a way to get it to your mysql server. Without a password for root, how does phpMyAdmin get installed and run? If WAMP doesn't do that for you, UNINSTALL WAMP and do it right with the FREE Chapter 1 of Kevin Yank's book - and REMEMBER your root password! From phpMyAdmin, you can then create your database, tables, etc and assign db access privileges via the GRANT command.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    I am new to Mysql.
    I am reading Build your own database driven website using php and mysql by Kevin Yank 4th edition.

    My OS is Windows 7 Premium.

    I am having following problem.
    When I type "mysqladmin -u root status" on Command Prompt. I get following.

    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)

    Please help me how to fix this problem.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will need to specify the root password before you can run this command. If you do not know the root password then its better to reset it.

    Stop MySQL server.
    Search for my.cnf file in your MySQL installation folder and add skip-grant-tables under [mysqld].
    Start MySQL Server.
    Open command promot and cd to MySQL bin folder
    Enter MYSQL prompt as mysql -u root
    Execute the following command (Note: Replace YOUR_PASSWORD with your actual password.):

    UPDATE user SET Password=PASSWORD('YOUR_PASSWORD') WHERE Host='localhost' AND User='root';
    Remote [B]skip-grant-tables[/B from my.cnf
    Restart MySQL Server.

    Then you will be able to login to MySQL as:

    mysql -u root -p

    or run mysqladmin command as:

    mysqladmin -u root -p status

    -p flag defines that the root password will be supplied so as you run any of these command, you will be asked to input root password.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •