Link to home
Start Free TrialLog in
Avatar of luciliacoelho
luciliacoelhoFlag for Portugal

asked on

Missing link with DNS and Mysql

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
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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".
Avatar of luciliacoelho

ASKER

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
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.
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
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
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for Benfica só assertive. I'm going to try your recomendations.
Kind regards
LC