如何通过android设备连接到远程MySQL数据库?

如何通过android设备连接到远程MySQL数据库?,android,mysql,http,Android,Mysql,Http,当我在本地连接到上面的URL时,它工作正常。。。我的问题是,为了通过设备进行远程访问,我需要做哪些更改???(这与“http”有关,但如何编写它,URL?确保root配置为能够远程登录。 还要确保MySQL服务器的3306 tcp端口已打开 我以前用过这个,试试看 public static final String URL="jdbc:mysql://10.0.2.2/mydatabase"; public static final String USER="root";

当我在本地连接到上面的URL时,它工作正常。。。我的问题是,为了通过设备进行远程访问,我需要做哪些更改???(这与“http”有关,但如何编写它,URL?

确保root配置为能够远程登录。 还要确保MySQL服务器的3306 tcp端口已打开

我以前用过这个,试试看

    public static final String URL="jdbc:mysql://10.0.2.2/mydatabase";
    public static final String USER="root";
    public static final String PASSWORD="apple";
    public static final String Driver_Class="com.mysql.jdbc.Driver";