Can't connect to MySQL using user with password - mysql

I am setting up my local development environment using XAMPP for writing websites using Laravel.
The issue im facing is that I cannot connect to the MySQL database with any new user I create. I give one user limited privileges for only one database and cannot connect using the correct password.
I tried making an admin user with full privileges on all databases and tables, and still cannot connect with the correct password.
The returned error is always the same -
SQLSTATE[HY000] [1045] Access denied for user 'laravel'#'localhost' (using password: YES)
and
ERROR 1045 (28000): Access denied for user 'admin'#'localhost' (using password: YES)
where laravel is the username, admin is the other one etc.
This is not related to Laravel as I keep getting this error even when I try to connect from the command line (as shown in error code number 2).
The 'anonymous' user has been removed to make sure MySQL doesn't match it by mistake, I have flushed privileges and restarted services countless times.
The default root user without password can connect, but no new users that I create with passwords can.

Solved the problem by re-installing XAMPP, nothing else.

Related

phpmyadmin in ubuntu xampp can not login after flush privileges

I have installed xampp in my ubunut 16.04 vps. It was running nicely with phpmyadmin. all of a sudden I can not login my phpmyadmin with root user. It just refused and give me the painful error which can not solve. the error is:
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: YES)
I can login with phpmyadmin supercontrol user... but the super user does not have any access to mysql.user table.
then I add "skip-grant-tables" to /opt/lampp/etc/my.cnf file and login with root user . Now I cant set the root user's password anyway.
Can anybody tell me what is the best way to get rid of this situation? thanks in advance

Cannot connect to mysql datavbase ERROR Access denied for user... (using password: YES)

Running a php script or trying to connect via terminal (locally) I get the same error
Access denied for user... (using password: YES)
mysql -u username -p'password' -h ip db_name
It passes to the server but get's blocked because of password although correct value was provided.
I've tried several fixes associated to this scenario but to no avail.
When a tried to execute some queries which could provide extra info for the fix, I get
1142 - SELECT command denied to user ... for table 'user'
I've assigned username, password and all privileges in cPanel MySql databases section (for the database) but am unable to connect using the created user as if a root user is blocking access to the database.
Am on GoDaddy host.
These are the only actions that I can preform on my database

Error 1045 using password yes and restore data from wampserver

I have wamp running locally on my computer and was working just fine. I have a web application based on PHP and MySQL. I am using a password for the connection.
Suddenly, I got the following error:
MySQL ERROR 1045 (28000): Access denied for user 'root'#'localhost'
(using password: YES)
I tried to follow the answers of this post on stack. But nothing worked.
Ounce I open the mysql cmd and write down the password, it will close immediately.
I even used MySQL workbench, and I was successful to enter but on a different user with password. But the user I am using where my databases resides, is not accessible anymore.
I have a db called ncd, where I can see it on the other user but as empty.
Could I restore the data from wampserver ?
You can check your db on /mysql/ folder and them store it. And move to another mysql with another account and restore your db with same folder as above me talk it.

MySQL connection help - root user HAS privileges, but is being denied access?

I've been trying to figure this out for a solid 24 hours.
I'm with GoDaddy for hosting. I have installed MySQL Server and Workbench. I've successfully created my root user with a password on my local server.
I'm trying to send form data using post method to a database I've successfully created with Workbench.
When submitting the form, I keep getting the error: ERROR: Could not connect. Access denied for user 'root'#'localhost' (using password: YES)
I've tried creating a new user and granting all privileges to that new user as well, but it still doesn't work. Nothing is working.
What am I doing wrong?

Access denied while using XAMPP on OS X Mavericks

Does anyone know why I would be getting an Access Denied error using XAMPP on OS X?
When I go to localhost/phpmyadmin I get the message #1045 - Access denied for user 'root'#'localhost' (using password: YES)
and when I go to just localhost I get
Access forbidden!
You don't have permission to access the requested directory. There is
either no index document or the directory is read-protected.
Is this a permissions issue? I added the password root to the username root in the phpmyadmin config file, but that didn't work and it wouldn't explain why I am getting the error on localhost as well. What IS working is the virtual host I created called my.server, but other than that, I seem to be locked out for some reason.
This error:
#1045 - Access denied for user 'root'#'localhost' (using password: YES)
Is a MySQL error. That's saying that there was an attempt to connect to the MySQL server, and either the specified user account doesn't exist, or the passwords don't match. From another client that can connect, verify the user account exists
SELECT u.user, u.host, u.password
FROM mysql.user
WHERE u.user = 'root'
AND u.host = 'localhost'
If the password column is empty, then there's no password on that account. If there's a '*688D...' value in there, you can compare the value of the hash of the password you're supplying...
SELECT PASSWORD('mysecretpassword')
Also, I'd recommend you create a DIFFERENT database user account (other than 'root'#'localhost', for use by your PHP scripts. (As one advantage, this will allow you to apply the security principle of "least privilege", granting only the privileges required.
The other error is saying that the webserver isn't configured to allow access to the URI you've specified, in the case of "http://localhost/", the webserver isn't configured to allow access to the ROOT of the webserver directory. (This is usually a really a good thing, in terms of security, not exposing the contents of this directory.)