EC2 MySQL Remote Access

Skip to end of metadata Go to start of metadata

To access MySQL on EC2, you will use SSH tunnel, and do the following, 

  1. Install msygit if you have not done so (see Useful Tools).  This will give you SSH command line tools  

     

  2. Start SSH tunneling (password for phpdev is ...)

    ssh -L 13306 :localhost: 3306 phpdev @50 .19. 223.35
     



  3. Access MySQL on port 13306 (e.g. mysql -u tcloud -p -P 13306)

EC2 Setup

The following setup was done on EC2 which enables SSH tunneling access to EC2 MySQL instance. See http://blogs.oracle.com/divyen/entry/connecting_mysql_server_on_amazon for more details.  

  1. Edit /etc/ssh/sshd_config to set AllowTcpForwarding to yes.
  2. Restart sshd nad mysqld

    sudo /etc/init.d/sshd restart
    sudo /etc/inid.d/mysqld restart

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐