How to prevent mysql from always connecting to localhost?

1

I'm trying to do a mail service and I'm using dovecot but at the moment of wanting to login as a dovecot user it always throws me the same error posftfix @ localhost does not exist which is true because it is not using my domain.

Try to enter the database with the following:

$ mysql -u postfix@'dominio.com' -p 

but after entering my password it tells me that the user does not exist but because mysql concateno localhost with my domain in this way

postfix@'dominio.com'@'localhost'

How can I avoid trying to access localhost by default in mysql

    
asked by Marco Leslie 23.11.2017 в 20:07
source

1 answer

0

If the server is not the local you must use -h .

mysql> –h "nombre o ip del servidor" –u "nombre de usuario" –p "contraseña"

If the server is local , you can omit -h :

mysql>  –u "nombre de usuario" –p "contraseña"

It must be taken into account that mysql by default does not allow external connections, it must be explicitly enabled.

    
answered by 23.11.2017 в 20:14