LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2018, 10:35 PM   #1
nsoma26@gmail.com
LQ Newbie
 
Registered: Feb 2018
Posts: 2

Rep: Reputation: Disabled
unable to connect to any of the specified host exception is displaying while trying to connect to remote database


Not able to connect database from my local machine to remote database through c# code

string dburl = "Data Source=10.10.10.10;user id=****;password=***";

MySqlConnection MyCon = new MySqlConnection();
MyCon = new MySqlConnection(dburl);
MyCon.Open();
Console.WriteLine("connected");


dummy data is entered in the data source
 
Old 02-27-2018, 07:15 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,944

Rep: Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810Reputation: 5810
Quote:
Originally Posted by nsoma26@gmail.com View Post
Not able to connect database from my local machine to remote database through c# code

string dburl = "Data Source=10.10.10.10;user id=****;password=***";

MySqlConnection MyCon = new MySqlConnection();
MyCon = new MySqlConnection(dburl);
MyCon.Open();
Console.WriteLine("connected");

dummy data is entered in the data source
Read the "Question Guidelines" link in my posting signature. You've posted one *VERY* small piece of code, with zero context, told us what kind of database (ASSUMING MySQL), version/distro of Linux, any error(s)/message(s) you're seeing, or what kind of environment you're in. There are LOTS of reasons this wouldn't work, such as:
  • Firewall/network security
  • Bad user ID/password
  • Database not set up to accept connections from your particular host
  • Your code is wrong
  • You don't have permissions to write/read the database
Among others. Provide details and we can try to help. Post code in CODE tags.
 
Old 03-07-2018, 05:12 AM   #3
nsoma26@gmail.com
LQ Newbie
 
Registered: Feb 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
I'm trying to connect to mqsql data base
Connection string is correct valid values only am passing
Unable you connect to any of the specified host error message is displaying
Database=MySQL
Environment= Linux 3.10 x86_64 VM development environment
Could you please tell us how to enable the ports on MySQL database might be I have missed some config.
 
Old 03-07-2018, 08:27 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Check if you have " skip-networking " set in /etc/my.cnf or in /etc/my/cnf.d/server.cnf (or equivalent server configuration file)
If yes, you have to comment it and restart mysql
 
Old 03-08-2018, 06:50 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177
Various possibilities:
  • Is MySQL actually running on that server?
  • Can you communicate with it? (Does ping 10.10.10.10 show any results?)
  • Might there be a firewall in the way?
  • Is the MySQL server configured to accept connection-requests from your IP?
  • Since I know that this IP-address is one that is used only on internal networks, "ask your IT department for assistance."
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to connect to the remote host vojd Linux - Networking 3 06-22-2013 12:54 PM
[SOLVED] Postfix/SASL Unable to connect to remote host martvefun Linux - Server 14 11-12-2012 10:00 AM
unable to connect to remote host using ssh tariq Linux - Newbie 31 11-04-2011 09:01 AM
[SOLVED] Unable to connect to remote PostgreSQL database with java.derby ChrisKlinger Linux - Server 1 08-28-2010 03:06 AM
telnet: Unable to connect to remote host: No route to host grob115 Linux - Networking 3 07-30-2010 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration