DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = java JDBC with mysql not connecting from external host.? - iTechForums
Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2008, 08:18 AM
Chad Chad is offline
Junior Member
 
Join Date: May 2008
Posts: 7
Default

java JDBC with mysql not connecting from external host.?


I'm playing with java jdbc with mysql, i've had a webserver with mysql installed for awhile. The webserver is running Ubuntu linux.

I'm trying to run a small java program i found somewhere to test the connection to the MySQL db. It will not connect with this error given:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure.

But I sshed into my server and installed the jdbc driver and ran that program with localhost and it worked.

here's the line in the program that I tried to use to connect:
String url = "jdbc:mysql://myserversIP:3306/";

How can i narrow down the problem? Could it be the router? not allowing on that port or is the mysql server only allowing connections via localhost if so how do i change that? I created a new user for mysql and set the host to %.

thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse ==> Class.forName("com.mysql.jdbc.Driver");? aryaxt MySQL 0 05-12-2008 09:10 AM
having trouble connecting mysql and java.? Chad MySQL 0 05-12-2008 09:09 AM
Getting external IP address in JAVA? M S Java, Java Servlets & JSP 0 05-10-2008 05:42 AM
hello i m trying to make a project in java using servlets n jdbc .........? well thts it...... Java, Java Servlets & JSP 0 05-06-2008 01:46 PM
need help with connecting to a mysql server? anthony c MySQL 3 05-06-2008 01:40 PM

Your Ad Here

All times are GMT. The time now is 03:34 AM.