C
C
Carry2014-09-18 13:00:18
MySQL
Carry, 2014-09-18 13:00:18

Why does mysql(i)_connect connect by ip but not by the same host?

To check I made a simple file:

<?php
mysql_connect("8x.xxx.xxx.xxx", 'bd', "xx") or die("Could not connect: " . mysql_error()); ;
mysql_select_db('bd') or die ('Can\'t use foo : ' . mysql_error());
?>

writes
Could not connect: Access denied for user 'bd'@'Debian7' (using password: YES)
in the Mysql database in my table like this:
| user | host | password |
+------------------+-----------------------------+ -------------------------------------------+
| root | localhost | *xxx |
| root | debian7 | *xxx |
| root | 127.0.0.1 | *xxx |
| root | ::1 | *xxx |
| | localhost | |
| | debian7| |
| debian-sys-maint | localhost | *xxx |
| bd | % | *xxx
if I understand correctly by ip we get to the host of the system itself
and how to make the user bd work, while he also has all possible hosts listed
By the way WorkBench works without problems
Only this option comes:
| bd | debian7 | *xxx |

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question