1

I am new to MySQL database, I want to Get or Set data into my database by using my C# winform application, therefore I need to know the required connection string for my database present on a webserver having shared IP address. The name of my database is shop_ListDatabase, The shared IP address of my website is 91.215.159.xxx, consider user name and password is (UserName, Password), website is example.com.

I have searched many hours on the internet but did not find suitable answer. The search results are all about Database on a local machine, but my database in on my website.

1
  • Even if you send a request from the same server, just setting your connection to "localhost" may prevent you from connecting with an ip address. You can try setting it to connect from any computer ( % ). Commented Jan 17, 2023 at 9:02

1 Answer 1

3

You need to specify the port. Default port is: 3306, in that case your connection string should be something like :

Server=91.215.159.xxx;Port=3306;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Sign up to request clarification or add additional context in comments.

3 Comments

Following error occures: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. My port is 2082
Are you just having trouble connecting through PHP or can you not establish a connection to MySQL from the command line as well? If you cannot connect at all, verify the service is running and listening on port 2082 .
@Farid-ur-Rahman, forgot to mention your name in the comment, just see if you could connect to mysql through command line to the server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.