Remotely connect a MySQL database server with MyEclipse10.0

Source: Internet
Author: User
Tags reverse dns

Note: All operations in this document operate with the following conditions,

A, the remote Linux server has installed MySQL database

B, local computer can ping remote server

C, the MyEclipse has been successfully installed

First, download Mysql-connector-java-3.1.14-bin.jar

This is the drive that connects to the MySQL database.

Http://dev.mysql.com/downloads/connector/j/5.0.html

can also be downloaded to the official website, the URL is as follows: www.mysql.com

Second, the DB Browser Configuration connection in the MyEclipse

1. Open the DB Browser panel by the following operation

Window-> Show View->myeclipse database-> DB Browser

As shown in the following:

2. Configure Database Driver

A, right-click in the blanks, and appear as shown:

Drivertemplate Select mysqlconnectior/j

DriverName is free to fill in

Connectionurl as shown, test indicates the name of the database to connect to.

User name and password are your username and password to log in to the MySQL database on your linux server.

3. Next Test connectivity

Test connectivity by clicking on "Test Driver".

This dialog box shows that the connection has been successful.

Iii. Summary of test connectivity issues

1. Connection URL is incorrect

If the above error message appears, please check your connection URL, this time your connection URL may be wrong. If you do not fill in the database or port you want to connect to, you will see the above prompt. As long as the "jdbc:mysql://

2. Connection errors are caused by permissions that are not connected to the database

This prompt occurs because there is no local permission to connect to a remote database.

If you are setting up your own environment, the typical analog remote database server is installed in a local virtual machine. My remote server here is a local Linux virtual machine, Linux installed MySQL server. So I can operate the Linux server as root user. If you are in a corporate environment, please contact your company's network administrator or database administrator.

In general, you can try the following methods when you encounter such problems.

[Root @ Linux ~]# mysql--user=root-p

Enter Password: *******

Mysql>use MySQL

Mysql>grantselect,insert,update,delete on [db_name].* to [Username]@[ipadd] identified by ' [Password] ';

[Username]: User code for remote login

[Db_name]: Indicates the database to be open to users

[Password]: User password for remote login

[IPADD]:IP address or IP reverse DNS Name, the contents of this example must be filled in ' 60-248-32-13.hinet-ip.hinet.net ', the package is enclosed in quotation marks (')

Brackets "" Do not enter when using the command.

Over here:

I am using virtual machine to simulate server, server address: 192.168.214.187, host is: 192.168.214.18

In the server's MySQL knock: Mysql>grant select,insert,update,delete on store.* to [email protected] identified by ' 123456 ';

Can be connected to the

But then, after that, it's not connected.

The connection database driver in the code is this:

public static final String dbdriver= "Com.mysql.jdbc.Driver";
public static final String dburl= "Jdbc:mysql://192.168.214.187:3306/store";
public static final String dbuser= "root";
public static final String dbpass= "123456";

You can connect to it.

Remotely connect a MySQL database server with MyEclipse10.0

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.