IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Linux Discussion :

Impossible de se connecter à mysql par telnet


Sujet :

Linux

  1. #1
    Membre actif
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    551
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2004
    Messages : 551
    Points : 264
    Points
    264
    Par défaut Impossible de se connecter à mysql par telnet
    Salut,

    Je ne peux pas me connecter en telnet à MySQL sur mon localhost auquel j'accède via SSH. MySQL tourne sans problème avec le couple Apache-SSL/PHP/MySQL mais impossible de s'y connecter par telnet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    telnet 127.0.0.1 3306
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection timed out
    Pareil avec localhost
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    telnet localhost 3306
    Trying 127.0.0.1...
    Trying ::1...
    telnet: Unable to connect to remote host: Connection timed out
    Netstat confirme qu'il tourne bien sur le port 3306:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    netstat -alpent | grep 3306
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      105        522804419   17231/mysqld
    tcp        0      1 127.0.0.1:39268         127.0.0.1:3306          SYN_SENT    0          522915717   17433/auth
    tcp        0      1 127.0.0.1:39254         127.0.0.1:3306          SYN_SENT    0          522915266   17434/auth
    tcp        0      1 127.0.0.1:39250         127.0.0.1:3306          SYN_SENT    0
    Je peux me connecter en ligne de commande avec -h localhost:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    mysql -h localhost -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 106
    Server version: 5.1.69-0ubuntu0.11.10.1 (Ubuntu)
     
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
     
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
     
    mysql> exit
    Bye
    Mais pas avec -h 127.0.0.1:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    mysql -h 127.0.0.1 -u root -p
    Enter password:
    ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (110)
    J'ai bien mis 127.0.0.1 dans bind-address vi /etc/mysql/my.cnf:
    ...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #bind-address           = localhost
    bind-address           = 127.0.0.1
    J'ai redémarré MySQL:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    /etc/init.d/mysql restart
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql restart
     
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) and then start(8) utilities,
    e.g. stop mysql ; start mysql. The restart(8) utility is also available.
    mysql stop/waiting
    mysql start/running, process 17464
    Les règles IpTable sont vides:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    iptables -L
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
     
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
     
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    En fait je ne peux me connecter via telnet à aucun service:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    telnet 127.0.0.1 80
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection timed out
     
    telnet 127.0.0.1 443
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection timed out
    Mon fichier /etc/hosts:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    127.0.0.1       localhost
    127.0.0.1       mail.mydomain.com
    ::1             localhost ip6-localhost ip6-loopback
    fe00::0         ip6-localnet
    ff00::0         ip6-mcastprefix
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters
     
    # Auto-generated hostname. Please do not remove this comment.
    205.xxx.yyy.zzz ve.uuuuuu.bbbb.cccc ve
    Ce problème est arrivé avec une migration de Ubuntu 11.04 vers 11.10. J'aimerais arranger ce soucis avant de faire une migration vers la 12.04.

    Je ne sais pas quoi vérifier et Postfix ne peut pas se connecter à MySQL pour fonctionner.

    Est-ce que quelqu'un aurait une idée ?

    Merci.

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    551
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2004
    Messages : 551
    Points : 264
    Points
    264
    Par défaut
    Résolu !

    Problème avec l'interface lo qui bizarrement n'était pas activé:
    A permis d'arranger tout ça.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. impossible de me connecter à mysql!
    Par Shyboy dans le forum Requêtes
    Réponses: 11
    Dernier message: 03/07/2006, 21h22
  2. impossible de me connecter à mysql
    Par bris dans le forum Installation
    Réponses: 5
    Dernier message: 09/03/2006, 09h29
  3. impossible de se connecter à MySql
    Par nazaghi dans le forum Débuter
    Réponses: 15
    Dernier message: 27/01/2006, 20h33
  4. Erreur 1045 impossible de se connecter à mysql via un script
    Par julian-brokendolls dans le forum Installation
    Réponses: 7
    Dernier message: 05/01/2006, 04h23
  5. problème de connection mysql par tcp/ip
    Par leroyphil dans le forum Administration
    Réponses: 5
    Dernier message: 04/09/2003, 18h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo