FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Unable to connect to MySQL - SOLVED

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Plotinus



Joined: 23 Nov 2008
Posts: 3

PostPosted: Sun Nov 23, 2008 12:58 pm    Post subject: Unable to connect to MySQL - SOLVED Reply with quote

Hi, everybody,
I am a newbie in everything and I've spent lots of time because I am not able to connect to mySQL despite of the readed posts and googling time.
I work with ubuntu 8.04 and xampp, I can connect with mysql via phpmyadmin, I can create tables, etc. I have a little php application that works fine. I reach this application by typing http://localhost/myApp/myApp.php (with no port number).
I've installed NetBeans 6.5, with no problem. I've created my first project.
But when I go to Services -> Databases, and try to connect to the server, I get an error message:
Unable to connect to the MySQL server:
org.netbeans.api.db.explorer.DatabaseException: org.netbeans.api.db.explorer.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure.

Last packet sent to the server was 0 ms ago..

The server may not be running... etc etc


And when I edit the MySQL connection properties, I get:

Server Host Name: localhost
Server Port Number: 3306 (I think it's ok, when I connect to the application I never type the port number, but in the mysql config file stays this value).
Administrator User Name: root (usually I connect to phpmyadmin with this user)
Administrator Password: ***** (the same with I connect to phpmyadmin)


I have no idea of java (needed?) and cannot figure out what happens. Sure it must be a very silly thing...
Can anybody help me? Any suggestion or help will be strongly welcome.
Thanks in advance,
P



Added:
When I right-click on Services -> Databases -> Drivers -> mySQL and put in the parms of the connection, I get another error:

Unable to add connection. Cannot establish a connection to jdbc:mysql://localhost:3306/myApp using com.mysql.jdbc.Driver (communications link failure).

Those parms are:
Data Input Mode: Field entry
Name: MySQL (connector/j driver)
host: localhost
port: 3306
database: mydatabase
user name: root
password: ***** same as above




Solution:
Thanks to the post in http://forums.netbeans.org/post-14735.html, I edited the /opt/lamm/etc/my.cnf file, and commented the line with "skip-networking".
Back to top
View user's profile Send private message
Futaleufu_John
Posted via mailing list.





PostPosted: Mon Nov 24, 2008 8:40 pm    Post subject: Unable to connect to MySQL Reply with quote

Check out the following thread. Note the last post's reference to the MySQL
variable skip-networking.

http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-to20616473.html
http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-to20616473.html

Plotinus wrote:
Quote:

I've installed NetBeans 6.5, with no problem. I've created my first
project.

But when I go to Services -> Databases, and try to connect to the server,
I get an error message:

Unable to connect to the MySQL server:

org.netbeans.api.db.explorer.DatabaseException:
org.netbeans.api.db.explorer.DatabaseException:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
link failure.


--
View this message in context: http://www.nabble.com/Unable-to-connect-to-MySQL-tp20646543p20668549.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Plotinus



Joined: 23 Nov 2008
Posts: 3

PostPosted: Mon Nov 24, 2008 10:23 pm    Post subject: Thank you! Reply with quote

Thank you!
It was what I needed!
Finally the connection is working.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB