LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-27-2012, 02:40 AM   #1
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Rep: Reputation: 3
Not Able to Connect to Remote Database Server..


Hi,

I am having two servers, one is configured with lamp and another is wamp. now i am trying to connect database to lamp server to wamp server. i have made changes in configuration.php file according to the lamp server. but i am getting error.

"database connection error (2) could not connect to mysql"

Thanks:

banghead:
 
Old 08-27-2012, 03:17 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

there are a number of things that could be causing this. For example

- mysql may be configured to only accept connections from the localhost
- there may be a firewall blocking the port
- etc.

To try to isolate the problem you should look at the logs on the machine running the mysql server. You can also try connecting to the msyql server via the command line to try to understand that is happening. For example

Code:
mysql --verbose --user=someone --password=secret --port=3306 --host=mymachine dbname
HTH,

Evo2.
 
Old 08-27-2012, 05:06 AM   #3
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by evo2 View Post
Hi,

there are a number of things that could be causing this. For example

- mysql may be configured to only accept connections from the localhost
- there may be a firewall blocking the port
- etc.

To try to isolate the problem you should look at the logs on the machine running the mysql server. You can also try connecting to the msyql server via the command line to try to understand that is happening. For example

Code:
mysql --verbose --user=someone --password=secret --port=3306 --host=mymachine dbname
HTH,

Evo2.

thanks for reply evo
but i have checked firewall, but there is no any issue with it.
i have also connected database server via mysql workbench also and i can access database server via linux but not able to connect using windows with wamp.
 
Old 08-27-2012, 04:10 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

have you tried it via the commandline on the windows box?

Evo2.
 
Old 08-28-2012, 01:20 AM   #5
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Original Poster
Rep: Reputation: 3
yes its working
 
Old 08-28-2012, 01:35 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by dushyantgohil View Post
yes its working
But using the exact same machine you can't connect using the same parameters in a php script?

Evo2.
 
Old 08-28-2012, 05:04 AM   #7
dushyantgohil
Member
 
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Original Poster
Rep: Reputation: 3
exactly
 
  


Reply



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
[SOLVED] [Question] How to connect remote database server in Virtual Box ubungu Linux - Server 12 06-28-2012 02:48 PM
Unable to connect MS SQL server 2008 Remote Server through SQUID proxy server samank75 Linux - Server 5 01-19-2012 09:19 PM
Can't connect to remote database cjbnt198 Linux - Newbie 3 11-16-2010 11:36 AM
[SOLVED] Unable to connect to remote PostgreSQL database with java.derby ChrisKlinger Linux - Server 1 08-28-2010 03:06 AM
Using Tora to connect to remote database devinWhalen Linux - Software 0 02-18-2004 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:06 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
Open Source Consulting | Domain Registration