I am trying to connect to a MySQL database server (remote), but I can't. I am using an user with grant privileges (not root user). The error message is the following:
Can't obtain database list from the server.
Access denied for user 'myuser'#'mypcname' (using password: YES)
"myuser" is an user I created with grant access. This user allows me to connect locally to every database. I am using the same software versions in both hosts: MySQL Server 4.1 (server) and EMS SQL Manager 2005 for MySQL, edition 3.7.0.1 (client).
The point is that I need to connect to the remote server using a different user, not root user. So, how to make the connection?
Thanks.
You have to make sure that the remote user account matches what the server will see coming in for a connection. For instance:
grant select on dbname.* to myname#mypc;
will not work if mypc is not resolvable on the server via DNS or the hosts file. In this case, you could try either using an IP, or a FQDN:
grant select on dbname.* to myname#10.1.2.3;
grant select on dbname.* to myname#mypc.example.com;
Look in connectionstrings.com to see if you have the right connection string used for MySql.
Make sure
that your MySQL server listens not only on localhost
your user can access the server from his location. Try 'myuser'#'%' in the GRANT command.
//EMS manager for mysql
//this magnificient tool provide you with a way to connect to such a server that prevents access to the server from any remote file or any way from outside world
//all you need is to have ftp access to the remote server
//in c:/program files/Ems/ you will find file called emsproxy.php
//it is what we call An (API) in programming world
//upload that file to your remote server
//then when you connect with EMS you select tunnling -->checkbox
//it will ask you on the next step to provide a full url of your emsproxy.php
//i tested that process myself. i did not have access to cpanel nieghter phpmyadmin
//thanks
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 want to connect to a remote mysql database and fill in an IP address, but what is prompted here is another IP address(My local ip). What should I do? How can I solve it?
I haven't searched related questions, only found a jdbc: rmi://, but mysql does not seem to need rmi.
The connection to the remote server succeeded. But the user connecting is not allowed to. The message you've got is from MySQL.
So you need to use a user that can connect remotely or you need to grant access for 'root'#'171.221.xxx.yyy' e.g. GRANT ALL PRIVILEGES on database.* to 'root'#'171.221.xxx.yyy' identified by 'aPassword'
I am trying to connect to an existing mysql database on a linux server and scaffold tables in my project and working with them via EFCore.
I use this command line to scaffold :
dotnet ef dbcontext scaffold "server={IP};port={PORT};userid={USER_ID};password={PASSWORD};database={DB_NAME};" Pomelo.EntityFrameworkCore.MySql -o Models -f
But it shows this error to me:
Host '{MY_IP}' is not allowed to connect to this MySQL server
I am using Pomelo.EntityFrameworkCore.MySql library on .NET Core 2.1 SDK
What should I do?
If your MySQL instance is bound to the public IP address (you can check this by doing 3306 port scan for that IP - assuming MySQL is running on the standard port) then you need to grant privileges on the database for the user you are using as follows:
GRANT ALL PRIVILEGES ON <yourdb>.* TO `<youruser>`#`<yourip>` IDENTIFIED by '<yourpassword>';
After you have run this you need to run the FLUSH PRIVILEGES; command. Assuming all above conditions are met you should be able to access your DB remotely.
There are 2 things to understand before trying to connect.
1) Generally, databases are allowed to listen to local machine, ie localhost.
2) databases as mysql authentication comes in pair i.e. user#host_name.
So changing the way DB want you are really screwing security.
Now here is the way you can change MySQL listen for rest of world.
1) go to **my.cnf**, Check ‘**bind-address**’, comment this line. it
must be bind with `localhost` or `127.0.0.1`.
2) go to database MySQL, table users, column host replace
`localhost` to `"%"`, so the anyone from anywhere can connect.
3) `CREATE USER ‘root’#‘%’ IDENTIFIED BY ‘some_pass’`;
4) `GRANT ALL PRIVILEGES ON *.* TO ‘root’#‘%’;`
5) `FLUSH PRIVILEGES;`
Using MySQL Workbench in Windows 7 how can I bind my MySQL Server to my IP Address instead of 127.0.0.1 and how can I give users from different hosts access to it?
From here:
Open a DOS command prompt on the server.
Run the following command from the mysql\bin directory:
mysql -u root --password=
A mysql prompt should be displayed.
To create a remote user account with root privileges, run the following commands:
GRANT ALL PRIVILEGES ON . TO 'USERNAME'#'IP' IDENTIFIED BY 'PASSWORD';
It depends on hosting server on which the database is hosted e.g. by Hostgator hosting you may bind IPs to access the database remotely, you will have to provide access to user IPs in the hosting. For other like Go Daddy it depends on while creating the database, you will have to select for remote database option which generated a url likewise a host with which database can be accessed with SQLYog/Workbench.
My Answer is you can't bound the IPs with database tools but only with hosting servers.
I have set up a MySQL server on Debian Linux and need to access a database on this server via vb.net. I found some help on Code Project to download the connector.net library and build a class to access the MySQL database. However when I try to connect I get the authentication error below when attempting to establish a connection with the mysql server:
Authentication to host '192.168.68.47' for user 'root' using method 'mysql_native_password' failed with message: Access denied for user 'root'#'' (using password: YES)"} System.Exception
It seems that the library is appending the Windows workstation and domain to the user name and I am getting error. I tried using the root user with "#IPaddress" of the workstation, but it simply appended the workstation name and domain to this user. I also tried with another user besides root.
This is perfectly logic, because on your mysql server you need to Grant access to your host so it will be allowed to connect to, you can do it by following instructions in the following
Link
Also in the mysql configuration file, in your case : /etc/mysql/my.cnf you need to delete the line
bind-address = 127.0.0.1
This line will restrict all access from remote hosts, deleting it will allow access from remote hose which is what you want to do.
Hope this helps.