Example for JSP MySQL connection

 JavaServer Pages (JSP) is a Java standard technology that enables you to write dynamic, data-driven pages for your Java web applications.  Below is the example of  MySQL database access using JSP. <%@ page import = “java.sql.*”%>Obtaining a Connection <% Connection conn=null; ResultSet result=null; Statement stmt=null; ResultSetMetaData rsmd=null; try { Class c=Class.forName(“com.mysql.jdbc.Driver”); } catch(Exception e){ out.write(“Error!!!!!!”

How To Enable MySQL Query Log

It is best to enable MySQL query log so that you can backtrack your codes and steps for troubleshooting purposes. To do so, you will need to edit your MySQL configuration file. Step 1 – Login into your web server via SSH. Step 2 – Edit your MySQL configuration file by running the following commands.

How to Upgrade MySQL Version with DirectAdmin CustomBuild

If your server has DirectAdmin installed as the control panel with the CustomBuild plugin, MySQL can be updated with the following steps:   1. Navigate to the custombuild folder # cd /usr/local/DirectAdmin/custombuild   2. Edit the options.conf as below: # mysql=5.1 # mysql_inst=yes # mysql_backup=yes **MySQL: possible values are 5.0, 5.1, 5.3, 5.5, 5.6  

How to create MySQL database in DirectAdmin (Enhanced Skin)

Introduction This knowledge base will guide you through the steps to create a MySQL database in DirectAdmin   Prerequisites Access to DirectAdmin: Ensure you know your username and password to log in to DirectAdmin.   Steps to create MYSQL Database 1. Login into Direct Admin as user. 2. Under Your account, click MySQL Management 3.

How to repair MySQL database in DirectAdmin

When you cannot access your website and you are seeing this kind of message: SQL query: DELETE FROM sessions WHERE expiry <1349879630 MySQL said: #126 – Incorrect key file for table ‘./your_database/sessions.MYI’; try to repair it It is possible that the hosting server had crashed and rebooted. After the server has restarted, your database tables

How to Backup/Restore MySQL database with mysqldump command

Mysqldump is an effective tool to backup MySQL database. It creates an .sql file with DROP table, CREATE table and INSERT into sql-statements of the source database. 1. To back up a database, use the command as below: #mysqldump -u db_username -p [database_name] > dumpfilename.sql Key in the password when requested. 2. To restore a

MySQL remote connection for Windows Shared Hosting:

Remote access to MySQL database on Windows Shared Hosting is enabled by default, simply use SQLyog available at http://code.google.com/p/sqlyog/downloads/list: 1. Install and run SQLyog 2. Click on New… 3. Enter the following info: Host Address: yourdomain.com Username: DatabaseUser Password: DatabaseUserPassword Port: 3306 Database: DatabaseName 4. Click on connect

How To Allow Access To Remote MySQL Database Using SSH

If your web server does not have phpMyAdmin installed, you may add remote host for your database by first accessing your web server via SSH. Step 1 – Login into MySQL server. Step 2 – If you wish to allow database user “ips1” to access database “myDatabase” at IP address “192.168.1.1“, execute the following command.