-2

I'm trying to connect to A MySQL database in order to use it for asp.net project in c#.

I'm getting error 40 on SSMS which means I inserted the wrong server name or the MySQL server doesn't allow remote connections.

Error from mysql workbench:

Check that mysql is running on server [ip]. 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 [ip] 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 [ip] connecting from the host address you're connecting from

  • Ip of the server is correct
  • mysql server is correctly installed
  • I can enter mysql with root and password by putty
  • I created an user@myipaddress to log from ssms
  • I granted the user created all priviliges with GRANT ALL ON *.* TO 'user'@'ip' WITH GRANT OPTION;
  • I tried editing iptables with sudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
  • I enabled ufw and allowed MySQL
  • I modified the mysql config file inserting binding-address:0.0.0.0 and port:3306.

I'm using almaLinux vps. I installed MySQL server using yum install mysql-server. I can't really get what is the problem.

Thom A
  • 88,727
  • 11
  • 45
  • 75
  • What does SSMS (**SQL Server** Management Studio) have to do with a MySQL question? As it's name suggests, SSMS is for SQL Server, not MySQL. – Thom A Aug 07 '23 at 11:00
  • Also, you say you're getting an error, but you forgot to include that error in your question. – Thom A Aug 07 '23 at 11:01
  • no, i didn't forget there are literally two images linked to the post, ssms is the application i'm using to connect from my pc (which uses my ip) to the mysql server hosted on the vps. so ssms is directly interested in the post. – Andrea Costa Aug 07 '23 at 11:05
  • [Please do not upload images of code/data/errors when asking a question.](//meta.stackoverflow.com/q/285551) – Thom A Aug 07 '23 at 11:07
  • *" ssms is the application i'm using to connect from my pc (which uses my ip) to the mysql server"* That won't work. As I stated SSMS (**SQL Server** Management Studio) is for SQL Server; MySQL and SQL Server are *completely* different RDBMS products. Use an application designed for MySQL if you want to connect to a MySQL instance (MySQL Workbench, for example). – Thom A Aug 07 '23 at 11:08
  • ok sorry, i thought it would be helpful for a person to look screenshots of what i have done, by the way you aren't even trying to help me, you just saying me what to do or not do. – Andrea Costa Aug 07 '23 at 11:09
  • Screenshots of errors are *never* helpful. – Thom A Aug 07 '23 at 11:10
  • ok i will try using mysql workbench and then eventually update or close the post, thanks for the answer – Andrea Costa Aug 07 '23 at 11:10
  • 1
    I’m voting to close this question because it appears to be caused by user error; they are attempting to use the wrong application. It's therefore similar to a question which is not reproducible or caused by a typo; it is unlikely to be resolved in a way helpful to future readers and the solution is to use the correct application. – Thom A Aug 07 '23 at 11:12
  • i didn't resolve my problem so why it should be closed, i said i'm trying right now to use mysql workbench and update the post, why would you close the post not even waiting for an answer – Andrea Costa Aug 07 '23 at 11:14
  • As i was expecting i'm getting the same error on mysql workbench too. You said it is similiar to another question but i said since the start that i already watched all the relative arguments to the post. i need help because it could be helpful to other people encountering my same problem, i did even express all the solutions which are said in the other posts. – Andrea Costa Aug 07 '23 at 11:20
  • I actually doubt that MySQL workbench and SSMS return the *same* error, what ever that error is. You're yet to include either in your question, just links to images, which as mentioned aren't helpful as noted in the prior [FAQ](https://meta.stackoverflow.com/q/285551) post linked. – Thom A Aug 07 '23 at 11:22
  • Check that mysql is running on server [ip]. 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 [ip] 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 [ip] connecting from the host address you're connecting from – Andrea Costa Aug 07 '23 at 11:26

0 Answers0