Solved

Missing link with DNS and Mysql

Posted on 2013-06-12
7
368 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 83

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 83

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 83

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

739 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