Running JSP with Mysql Database.

When you had the chance developing Jsp pages with Mysql as a database and Apache Tomcat 5.** as the back end server, and trying to run the simple database test connection and encounter the following error messages :

java.lang.ClassNotFoundException:com.mysql.jdbc.Driver

1st. If you are using IDE like eclipse or Netbeans, make sure you had include the java mysql connector jar file by the Eclipse right click on project look for Build Path and add the mysql .jar file into the library. Try and restart the apache tomcat server.

2nd. If it doesn’t work, copy the previous download mysql jdbc driver into directory one located at your apache tomcat common\lib folder; as C:\apache-tomcat-5.5.26\common\lib.

If this doesn’t work copy the file to C:\apache-tomcat-5.5.26\bin (i had no idea, basically i just copy and paste everything).

Restart the apache tomcat server and now it should be able to run!!.

Mysql Tips 1#

If you having trouble using mysql 5++ load data option and having an error message when issues that command
1. “ERROR XXXX: The used command is not allowed with this MySQL version” or
2. Denied access when trying to import csv file into your database table.

You might try looking something –local-infile. The default setting for –local-infile was off. You had to enable it by include in you mysql command.

For Example : mysql –host=.. –port=.. –local-infile –password=..
Then it should works now!.

For the second problem it might because the client you try to access is not root. It might be the privileges problem. Add the –local-infile line to the mysql command when you try to excute the user.

For more information you can refer to here : Load Data Error
For Connection Access Denied : Access Denied