Solved

Missing link with DNS and Mysql

Posted on 2013-06-12
7
361 Views
Last Modified: 2013-06-26
I have installed an apache server 2.2 along with mysql 5.0.8 and php 5.3.8.
The server is used in a intranet and I call it clini_apache in terms od DNS entry. In the hosts file I have put an entry to its name resolution 199.199.199.199 clini_apache (not real ip address).
The virtual host was configured to answer ip port number 85
If I test the DNS resolutuion through ping or tracert the DNS resolves the name clini_apache
If I try to access to PHPmyAdmin with url the clini_apache:85/PhpMyAdmin the browser reaches the server and I can log in.
In my php script when I try to connect to the server clini_apache I get a connection error.
Do you have any idea why this might be happening.
Should I change the 85 port to 3306 (default ip porto to mysql?)
Kind regards
LC
0
Comment
Question by:luciliacoelho
  • 4
  • 3
7 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39243645
No, 85 is the port for the web server.  That does not change or even affect the port for MySQL.  If phpMyAdmin is working then MySQL is working.  Maybe you are forgetting to add the port 85 to all links to the web server.  Any link that does not include it will be trying to use port 80.  You may have to make all your links relative to the server like "clini_apache:85/index.php" or "clini_apache:85/images/first.jpg".
0
 

Author Comment

by:luciliacoelho
ID: 39260143
I van reach the mysql server with a ping test and I get the following answer
C:\Windows\System32\drivers\etc>ping clinicare_apache

A fazer ping para clinicare_apache [192.168.1.100] com 32 bytes de dados:
Resposta de 192.168.1.100: bytes=32 tempo=1ms TTL=128
Resposta de 192.168.1.100: bytes=32 tempo<1 ms TTL=128
Resposta de 192.168.1.100: bytes=32 tempo<1 ms TTL=128
Resposta de 192.168.1.100: bytes=32 tempo<1 ms TTL=128

Estatísticas de ping para 192.168.1.100:
    Pacotes: Enviados = 4, Recebidos = 4,
             Perdidos = 0 (perda: 0%),
Tempo aproximado de ida e volta em milissegundos:
    Mínimo = 0ms, Máximo = 1ms, Média = 0ms

Note that my windows is portuguese
When I try to us mysql to connect to a database in a windows 2008 server with the same address of clinicare_apache I get this answer

C:\Windows\System32\drivers\etc>mysql -hclinicare_apache
ERROR 2003 (HY000): Can't connect to MySQL server on 'clinicare_apache' (10060)


Is there any other reason for not reaching the mysql server

Kind regards
LC
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39260308
MySQL requires a username and password (even on the local machine) and also requires it to be setup with the connection method before you can use it.  'mysql -hclinicare_apache' will never work because it does not include the required information.  If phpMyAdmin is working it is because the correct login info was entered when it was installed.  I believe that info is in 'config.inc.php'.

Note that MySQL and any web servers can be down as in not running at all and 'ping' may still work because it is an entirely different service.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:luciliacoelho
ID: 39260666
Right know, after installing the mysql client in another computer on the same network I received this message


ERROR 1130 (HY000): Host 'gabinete12.domain.local' is not allowed to connect to
this MySQL server


Kind regards
LC
0
 

Author Comment

by:luciliacoelho
ID: 39260783
Let me try to add some data and see if we get further on the clarification of this issue, probably a simply one due to my not so deep experience with MySQL server configuration.
Attached you will find some files to document the dificulties I'm having

The Screenshot Server Mysql 1 - Shows the Mysql session open as localhost in the server where mysql resides
The Screenshot Server Mysql 2 - Shows the message I get when I try to connect with the name clinicare_apache in the server where mysql resides (I previously recorded the name clinicare_apache on the hosts file of the server)
The Screenshot Server Mysql 3 - Shows the ping test to resolve the clinicare_apache name in the server where mysql resides

I get a similar error when I try to connect through a workstation authenticated in the windows network

The Screenshot Workstation Mysql 1 - Shows the try to open a Mysql session in a workstation of the same network where mysql server resides

Hope this can help you to help me. :-)
Kindest regards
LC
Screenshot-Server--mysql-2.png
Screenshot-Server-mysql-1.png
Screenshot-Server-mysql-3.png
Screenshot-Workstation-mysql-1.png
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39260994
First, 'ping' is totally irrelevant to MySQL.  At best, it tells you that the lowest level of the network interface is working, nothing more.  MySQL uses it's own protocol that must be accessed thru a driver or locally on the command line.

Second, Windows Authentication is irrelevant to MySQL.  It is simply not used in MySQL.

Third, the connection using 'localhost' will probably work with just username and password since you are connecting to the instance that is on that same machine.

Fourth, 'root' is normally restricted to connecting Only thru 'localhost' to prevent remote breakins thru the 'root' user.  Your attempts to connect to a remote host using 'root' should always fail.

To access a MySQL database remotely, you need to create users and passwords with the necessary access methods.  Then you need to give them privileges on the databases you want them to use.  Other than 'root' which should be zealously protected, there is no 'universal' access in MySQL.  See this page for adding users:  http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
0
 

Author Comment

by:luciliacoelho
ID: 39261503
Thank you for Benfica só assertive. I'm going to try your recomendations.
Kind regards
LC
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now