In our case, the database and the middle
In our case, the database and the middle tier will be hosted on different machines. So, grant all privileges on all objects in the shop database to user PHP, connecting from any machine: mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON shop.* TO ‘PHP@%’ IDENTIFIED BY “PHP”; Execute the following SQL script (shop.sql) at the command prompt to create the shopdatabase and tables: mysql < shop.sql CREATE DATABASE IF NOT EXISTS shop; USE shop; CREATE TABLE UserProfile ( fname VARCHAR(32) NOT NULL, lname VARCHAR(32) NOT NULL, userId VARCHAR(16) NOT NULL, password VARCHAR(16) NOT NULL, address VARCHAR(128) NOT NULL, city VARCHAR(64) NOT NULL, country VARCHAR(16) NOT NULL, zipCode VARCHAR(8) NOT NULL, gender VARCHAR(8) NOT NULL, age INTEGER NOT NULL, emailId VARCHAR(64) NOT NULL, phoneNumber VARCHAR(16) NOT NULL, cardNo VARCHAR(16) NOT NULL, expiryDate DATE NOT NULL, cardType VARCHAR(16) NOT NULL, accountBalance FLOAT NOT NULL, PRIMARY KEY(userId)); CREATE TABLE BookShop ( itemNo VARCHAR(20) NOT NULL, itemType VARCHAR(20) NOT NULL, title VARCHAR(60) NOT NULL, author VARCHAR(60) NOT NULL, price FLOAT NOT NULL, PRIMARY KEY(itemNo)); CREATE TABLE MusicShop ( itemNo VARCHAR(20) NOT NULL, Page 549
Quick Hint: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services