Solved

Missing link with DNS and Mysql

Posted on 2013-06-12
7
364 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 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

815 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

11 Experts available now in Live!

Get 1:1 Help Now