MYSQL setup with XAMPP

Posted on 2008-11-05
Last Modified: 2013-12-13
Hi, i haven't used xampp in about 3 years.
I now set it up to do some quick testing for PHP.
My Apache is running, mysql is running.
i left everything at defaults but i'm getting the error
#1045 - Access denied for user 'localhost'@'localhost' (using password: NO)

so after looking around at some other posts, i changed auth_ytp in the file to HTTP and added a password  abc.
now when i run localhost i get a pop up requesting username and password, i then see the list of databases on the left but the error still exists.

i'm not a d/b or php expert, if someone could please assist.
Question by:blue-genie
    LVL 7

    Accepted Solution

    #1045 - Access denied for user 'localhost'@'localhost' (using password: NO)

    I believe it the main account is root, not localhost, so like #1045 - Access denied for user 'localhost'@'root' (using password: NO) seems to be trying to connect to localhost, on a user called localhost, which isn't there in defaults.

    So if you want to get in mysql:
    1. Open a command prompt
    2. Go to the folder with mysql bin (C:\xampp\mysql\bin for example)
    3. Type: 'mysql -uroot' (Without the quotes, and if you put a password on root it would be mysql -uroot -ppassword).

    phpmyadmin should already be setup, all you need to do is login, but if you change passwords and such of mysql, then you need to edit this file: C:\xampp\phpMyAdmin\ for example, or where you installed it. But normally it uses the PMA account.

    If your using winmysqladmin, which is absolutely horrible, you just type in 'root' for user.
    LVL 7

    Expert Comment

    If your trying to connect to your DB, again, the user is 'root'
    LVL 39

    Author Closing Comment

    hi i thought i deleted the question.
    it turns out i was fiddling with stuff but i actually needed to restart the stuff before it kicked in.
    not sure what happened by it seems to be working now (its one of those I don't know how I got it to work and I'm not going to risk breaking it again).
    i did try the -uroot in command prompt earlier and that also told me i didn't have permissions.
    thanks for the info, as i go along i'm sure you'll hear alot more from me. are you a PHP expert? if yes i have a new question coming up.
    thanks :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Creating and Managing Databases with phpMyAdmin in cPanel.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now