Server version: 5.5.54-0ubuntu0.14.04.1 (Ubuntu)
I had an issue where a user lost the ability to connect to the mysql server from a remote application server.
user is created as 'user'#'%'
user has all privileges on the db in question
user connects remotely from a cron job and runs a daily report, connectivity just seems to have disappeared
failed: Access denied for user 'user'#'host' (using password: YES)
After confirming I could connect locally and remotely from a different server - on a whim, I issued flush privileges; this immediately resolved the problem.
I am trying to understand why - what event would have caused the lost connectivity? Really just trying to be able to explain it.
This problem has been resolved - ended up being a network issue that was contributing to intermittent connectivity issues - flush privileges, while appearing to resolve the problem actually was not part of the issue at all.
Thanks to everybody that took a look.
Related
So I am attempting to use MySQL workbench to connect to a database in the cloud on AWS RDS services.
When I attempt to connect I get an error like this.
Access denied for user 'admin'#'ip_octet1-octet2-octet3-octet4.res.spectrum.com' to database 'default_database'
I have the database set as publicly accessible and all IPS are able to connect. The problem seems to be my client is attempting to try to connect via hostname. I have tried multiple different clients, so it seems to be an issue with AWS or my ISP. I have been able to shell into MySQL instance from other EC2 instances.
Any suggestions would be appreciated.
Your mysql user permissions should allow connecting from the particular host. you can grant permission to the existing user as below.
GRANT ALL PRIVILEGES ON database_name.* TO 'admin'#'ip_octet1-octet2-octet3-octet4.res.spectrum.com';
Reference:
Create and Grant Mysql Permissions
Based on the error you are getting, this doesn't seem to be an issue with reaching the server, as the message complains about an access denied, otherwise it would state it can't reach the host. I would go for the password route, as the admin user should get created with '%' for host. Was it a snapshot? Or created from scratch? If so, was the password properly set? If it is from scratch, you can always delete it and create it again.
Regards!
I have a MySQL server (v8.0) running on windows server 2016. I also have IIS running and PHPMyAdmin installed. In addition to this, I have a PHP web application which runs on the same server (under IIS) which accesses the MySQL database. Finally, I have several Python scripts which access the MySQL database.
Somehow, I have lost the ability to access the database from the Python scripts, but the web application still works and PHPMyAdmin can see and modify the database.
Even more strangely, I can no longer user MySQL Workbench to access the server from a PC on the local network, and PHPMyAdmin cannot access the users table of the mysql database. I can't change user details at all through PHPMyAdmin, I get the error:
Error in processing request
Error code: 500
Error text: Internal Server Error (rejected)
It seems that the connection to server has been lost.
MySQL Workbench gives me this error:
Your connection attempt failed for user 'user' to the MySQL server at SERVERADDRESS:PORT:
Access denied for user 'user'#'SERVERADDRESS' (using password: YES)
I have checked that the server can accept connections from remote computers by adding bind-address=0.0.0.0 to the my.ini file. I have also checked to ensure that 3306 is allowed through the firewall.
Any ideas on what could be causing this issue?
ADyson and MrApnea pointed me in the right direction.
The problem was caused by my main database user having the host reset from % to localhost, I'm not sure how this happened or when. As the app was running locally, this was not affected, but all other access was denied (including MySQL workbench). My root user is set to local only for security.
To fix this, I connected to the server via RDP and logged in to the console as the root user. I then ran these commands to see the error:
use mysql;
select host, user from user;
This showed me that the main user account had "localhost" in the host. I ran this command to update this user:
update user set host='%' where user='username' and host='localhost'; flush privileges;
The errors are as follows:
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
I have trouble fixing this problem, I've tried the different solutions I've found on the internet especially the one where I had to change my password in config.inc.php.
It might be worth noting that prior to this error, phpmyadmin was working perfectly fine, and at the time I was getting MySQL to connect to VB.NET and installed the Connector and MySQL for Visual Studio. Furthermore, there was an error about SSL connections while connecting my database to Visual Studio. I did some exploring on my own and changed the settings of my database from NO SSL to REQUIRE SSL. Then the access denied page showed up from there.
Please help me out.
I just bought Coda 2 and I want to try this feature about mysql database connection. I´m not able to connect. The error that appears is:
Unable to connect to host 1.2.3.4, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges,
or try increasing the connection timeout (currently 0 seconds).
MySQL said: Can't connect to MySQL server on '1.2.3.4' (60)
The error takes 60 seconds to appear. For easy answers, Il´l make an example:
Server IP: 1.2.3.4
MYSQL Username: root
MYSQL Password: 1234root
I use xampp on a windows server. How can I connect to the mysql database remotely? About the privileges, the account I use for root has all privileges. Thank you and have wonderful holidays.
You need to configure your mysql server to allow remote access to root, usually a very bad idea. Remote access is bad enough. You would need to permit remote access and grant the root user at your remote address access.
see Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user
This is why people usually install something like phpMyAdmin to get this kind of access. Setting up a non root user is another choice.
I get the following error when trying to make a jdbc connection to a mysql database:
Attempting to connect to jdbc:mysql://localhost/castel castel castel
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'castel'#'%' to database 'castel'
I can connect to the database through the command line without a problem using the same credentials. I thought it might be a privilege issue so I ran:
GRANT ALL PRIVILEGES ON mysql.* TO 'castel'#'%'
Any help would be greatly appreciated.
OK the problem was completely unrelated to database configuration. It turns out my box had it's iptables configured to forward all traffic on port 3306 to another machine so I wasn't talking to the database that I thought was.