[SOLVED]Connecting to MySql in Managed Application Runtime



  • Using Linux Mint 16 KDE

    Created a Managed Database instance of Mysql

    Created key by
    ssh-keygen -t rsa

    copied contents of /home/user/.ssh/id_rsa.pub to Qt Cloud Console "Add SSH Key" in 'Personal Account' section.

    Tried to connect via ssh by
    ssh -vvv -N -L 49825:10.0.138.18:49825 admin@tunnel-mar-eu-1.qtc.io
    returns

    @debug1: Requesting no-more-sessions@openssh.com
    debug1: Entering interactive session.
    debug1: Remote: Forced command.
    debug1: Remote: User rc file execution disabled.
    debug1: Remote: Forced command.
    debug1: Remote: User rc file execution disabled.

    @
    and hangs there.

    I then tried
    plink -N -noagent -ssh -i /home/user/.ssh/id_rsa.ppk -L 49825:10.0.138.18:49825 admin@tunnel-mar-eu-1.qtc.io
    returns
    @Using username "admin".@
    and hangs there.

    I also tried
    mysql --host=10.0.138.18 --port=49825 --user=admin
    returns
    @No host found@


  • cid:52:privileges:purge

    Ssh tunnel does not return any output when it's established.. so it seems to "hang" forever. But after tunnel is established you should connect mysql client to 127.0.0.1, like this:

    mysql —host=127.0.0.1 —port=49825 —user=admin



  • Thanks for the reply.

    I tried

    1. ssh -vvv -N -L 49825:10.0.138.18:49825 admin@tunnel-mar-eu-1.qtc.io # in terminal 1 and after connecting

    2. mysql -h 127.0.0.1 -P 49825 -u admin -pLx2J4x7szdf4dskJYp3s2mPa # in terminal 2
      At first it returned Error 2002 . and so installed mysql-server
      Afterwards it returns @ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

    And in terminal 1 returns

    debug1: Connection to port 49825 forwarding to 10.0.138.18 port 49825 requested.
    debug2: fd 6 setting TCP_NODELAY
    debug2: fd 6 setting O_NONBLOCK
    debug3: fd 6 is O_NONBLOCK
    debug1: channel 2: new [direct-tcpip]
    channel 2: open failed: connect failed: Connection refused
    debug2: channel 2: zombie
    debug2: channel 2: garbage collecting
    debug1: channel 2: free: direct-tcpip: listening port 49825 for 10.0.138.18 port 49825, connect from 127.0.0.1 port 47481, nchannels 3
    debug3: channel 2: status: The following connections are open:
    @

    plink -N -noagent -ssh -i /home/user/.ssh/id_rsa.ppk -L 49825:10.0.138.18:49825 admin@tunnel-mar-eu-1.qtc.io

    in terminal 1 and mysql in terminal 2 returns

    @
    Forwarded connection refused by server: Connect failed [Connection refused]
    @


  • cid:52:privileges:purge

    It might be possible that mysql instance has not started properly. Try to launch another mysql instance and test with that.



  • Thanks.
    After deleting current mysql instance and creating a new mysql instance in the cloud solved the problem.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.