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.
Related
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;
I have a java project which connects to a MySQL database. Earlier it was working fine, but I think I messed up some of the configuration settings when trying to connect not via localhost. After messing around for hours and not making any progress (including completely reinstalling MySQL onto my mac and pc ( I was trying to connect these) ) I have given up and now am thinking of using some other database software like Postgre. Will the same error come up since its to do with not being able to connect as the server is not running?
The error at the moment is:
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Access denied for user 'root'#'localhost' (using password: YES)
Please:
Check that mysql is running on server 127.0.0.1
Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
I have followed the steps here:
ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server
Carried out this activity dozens of times and it worked -- now for some reason it is not
I have done:
Comment out bind-address in my.cnf and restart service
GRANT ALL PRIVILEGES ON . TO 'root'#'%';
FLUSH PRIVILEGES;
The only difference here is that MySQL is running in a VM under VirtualBox and I am connecting to the VM mysql instance via WIndows 7.
SSH and other services work fine...
The passwords are fine as they work when I connect via SSH...
My new modem/router possibly at fault, blocking outgoing or ingoing connections on port 3306???
I assume that traffic from a host to guest still goes through the router...but the thing is...my requests are certainly making to the MySQL server as the log file shows fail requests...
WTF amm I missing???
The error I receive: Error No. 1045
Access denied for user 'root'#'my-desktop' (Using Passowrd: YES)
You also have to edit my.cnf. Change:
bind-address = 127.0.0.1
to
#bind-address = 127.0.0.1
then restart mysql. Also, if you are going to allow outside access, create a user other than root. That's always a bad idea.
By default connection from outside are not allowed for security reasons.
Because exposing your database to the public internet is never a good idea, you will need to whitelist the IP address manually to allow connection.
I am running MySQL on an Amazon AWS Instance. I was able to previously connect to the MySQL Database via MySQL Query Browser. Now I am traveling outside the U.S. and I am having trouble connecting via the Query Browser. I am able to use Terminal to create an ssh connection and then login to MySQL, so it does not appear to be a larger issue with the MySQL Database.
Has anyone else had a similar problem? Any ideas how I can fix this?
This is the error I get from the MySQL Browser
Your connection attempt
failed for user 'admin' from your host to server at
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:3306: Can't connect to
MySQL server on 'ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com' (4)
Please: 1 Check that mysql is running on server
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
2 Check that mysql is
running on port 3306 (note: 3306 is the default, but this can be
changed)
3 Check the admin has rights to connect to
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com from your address (mysql
rights define what clients can connect to the server and from which
machines)
4 Make sure you are both providing a password if needed and
using the correct password for
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com connecting from the host
address you're connecting from
The only possible problem I see could be #4, but I ran and re-ran this command via Terminal:
grant all privileges on *.* to 'admin'#'%' identified by '<pass>' with grant option;
When I check the mysql query logs on our BSD server, I see, repeated again and again:
111123 8:23:11 4478 Connect Access denied for user 'Neohoo'#'localhost' (using password: YES)
4479 Connect Access denied for user 'root'#'localhost' (using password: NO)
I shut off outside access by adding the skip-networking option and restarting mysql:
cat /etc/my.cnf
[mysqld]
// The MySQL server
skip-innodb
max_connections=30
skip-networking
set-variable=local-infile=0
And verified by:
telnet bsdServer.com 3306
telnet: Unable to connect to remote host
The MySql is used with a legacy PHP application. I considered it could be an SQL injection attack but I am at a loss to find which section of the program. The mysql query logs do not show an IP address or any more useful data.
Any suggestions appreciated.
I shut off outside access by adding the skip-networking option
But these users are connecting from localhost - i.e. not across the network.
The mysql query logs do not show an IP address
Yes they do:
111123 8:23:11 4478 Connect Access denied for user 'Neohoo'#'localhost' (using password: YES)
Some client running on the machine is trying to connect.
If this machine is running a PHP webserver, particularly one facing the internet, most likely have a PHP code injection issue. Try cross referencing the timestamps on the log entries with your webserver access_log. If you've got the mysql client available on the machine, ensure that your webserver uid can't run it.