Remote connection to MySQL in Ubuntu

Source: Internet
Author: User

When DBCP connects to the MySQL IP address 127.0.0.1, the connection can be changed to a local real IP address.

Org. Apache. tomcat. DBCP. DBCP. sqlnestedexception: cannot create poolableconnectionfactory

It is said that the connection may be closed and you need to reconnect.

ADD? Autoreconnect = true

Incorrect result

Nested exception is org. Apache. commons. DBCP. sqlnestedexception: cannot
Create poolableconnectionfactory (cocould not create connection to database server. Attempted reconnect 3 times. Giving up .)

Still unable to connect

Depressed

Then the mysql-uroot-p-h real IP address is used to connect to MySQL and an error is reported.

MySQL error number 2003

Can't connect to MySQL Server XXX. XXX (10061)

Oh, I finally got it. The remote port MySQL does not recognize it. It's really TMD.

Originally in Ubuntu
MySQL is installed by default in 9.04, which can only be accessed locally by default.

Solution:

Authorize remote machines to access specified users

Grant
All privileges on *. * to root @ identified by "root ";

Restart MySQL

/Etc/init. d/MySQL
Restart

Log on again

MySQL
-Uroot-p-h IP Address

Still not good

Modify the MySQL configuration file

VI/etc/MySQL/My. CNF

Bind-address = 127.0.0.1 comment out

Restart MySQL

Successful

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.