I have created a free application using openshift, and created MySQL and phpmyadmin cartridges and inside my phpmyadmin I have gave access to all users from anywhere with all privileges now the problem is when I try to connect from my local MySQL workbench i get connected but I don't see my tables I have created in remote server using phpmyadmin and I can't do any action at all like creating schemas or tables where i get
ERROR 1044: Access denied for user ''#'localhost'
Remember that I allowed all privileges for any user, but I still get access denied for any action except only for the database connection.
Make sure the user you've given full permissions to is the same user MySQL Workbench is connecting as -- there's a difference between the hosts % and localhost for instance. From MySQL Workbench, issue the "Status" command and compare the username and host against what you've configured.
You're apparently connecting through 'localhost' so you have to give full permissions to the anonymous user with host localhost (or change your connection type to tcp so that your connection is via 127.0.0.1 instead of localhost).
Edit for further clarification: The MySQL permission structure treats different types of connections differently; a client connecting via TCP connection always appears to come from an IP address, even if it's from the "local host" (in the sense of being on the same machine), in which case that IP address of the incoming connection may be 127.0.0.1. Socket type connections are registered in MySQL as coming from the host "localhost" (literally, in this case). This is why we're verifying which host MySQL Workbench is connecting as.
Different connection types appear differently to MYSQL even if they're coming from the same "local machine." Furthermore, the wildcard host does not include 'localhost' socket connections, those are a separate entry in the permissions field with the 'localhost' host name; the wildcard does not apply, as I explained above. This is the reason why we're checking which permissions you set against what MySQL Workbench is connecting as; it's the most common cause of difficulties such as these.
Related
I'm trying to establish a connection to a MySQL server on a remote host. Both machines are running RH 7.5 and MySQL 5.7.
I can connect to the server as a root user. I did that, and used it to set up a secondary user like this:
CREATE USER 'foo'#'client-ip-address' identified by 'my-password';
and then
GRANT ALL PRIVILEGES ON my-db.* to 'foo'#'client-ip-addres';
That all went fine. But to my surprise, when I tried to connect using this new user, I got an error I wasn't used to:
$ mysql -u foo -h server-ip-address -pmy-password my-db
Access denied for user 'foo'#'some-hostname-not-an-ip.com' (using password: YES)
I know the IP address of the client (where I'm connecting from), which is why I set up the user with that value in the "host" column on the server. But the client is obviously trying to establish a connection using a value for "host" that is not the IP address. Instead it's some hostname, and not an IP address at all.
Where is this value coming from? How does mysql determine its own host when it tries to connect to a remote server? In the past I've only ever seen it use the machine's own IP address.
We have a Linux Vm which is running our OTRS. I have found the kernel file which has the database configuration details. In there the host name is listed as local host.
I tried using the server IP address along with the database username that is there; however I cannot seem to connect.
I also cannot find the port that is utilized. How do I connect to the database on mysqlworkbench,
Maybe server doesn't allow remote connections to the DB or user used by OTRS is only a local user?
If this is true you've got two options:
Create user that is allowed to login remotelyCreate user that is allowed to login remotely
Create user that is allowed to login remotely
Use Standart (TCP/IP) over SSH as connection method in MySQL workbench. This option allows to first connect over SSH to the server and than connect to the DB as local user
The error specifically says "Host ..com is not allowed to connect to this MySQL Server"
I have the correct userid and password which works fine on remote MySQL if I RDP and login locally.
The TCP port 3306 is not blocked as far as I am concerned. I used PortQry tool from my desktop and did "PortQry -n -e 3306" and I got "LISTENING" response.
Below is the excerpt from the mySql Docs
If the following error occurs when you try to connect from a host
other than the one on which the MySQL server is running, it means that
there is no row in the user table with a Host value that matches the
client host:
Host ... is not allowed to connect to this MySQL server You can fix
this by setting up an account for the combination of client host name
and user name that you are using when trying to connect.
If the following error occurs when you try to connect from a host
other than the one on which the MySQL server is running, it means that
there is no row in the user table with a Host value that matches the
client host:
Host ... is not allowed to connect to this MySQL server You can fix
this by setting up an account for the combination of client host name
and user name that you are using when trying to connect.
I hope this solves your problem.
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.
Where can I find the name of MySQL which I'll use at the connection string to connect to the database from c#?
If you're connecting to a db on the same server, it should be "localhost".
If you are connecting to a remote server, then it should be the FQDN of the remote server (or the IP address) - for example, "dbhost.lan.company.com".
"Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Access denied for user 'root'#'sfn-inkubator-70-61.hib.no' (using password: YES)" error means that you have setup connection address correctly. Client connects to server, but server rejects username and password combination.
So you need to check your server setup, create some user with known password and so on......
It's very possible your host blocks external access to your mysql db, quite a few do. This would explain why you can connect via myadmin.