CREATE DATABASE

1. CREATE DATABASE secure_login;

PS:  CREATE DATABASE  ‘secure_login’ does not work since ” could not use here.

2. use secure_login;

3. CREATE USER sec_user@127.*.*.* IDENTIFIED BY ‘U*****4’;

PS: Must add ‘ ‘ here.

4. GRANT SELECT, INSERT, UPDATE ON secure_login.* TO sec_user@127.*.*.*;

5. CREATE TABLE secure_login.members ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(30) NOT NULL, `email` VARCHAR(50) NOT NULL, `password` CHAR(128) NOT NULL, `hintQ` CHAR(128) NOT NULL, `hintA` CHAR(128) NOT NULL ) ENGINE = InnoDB;

PS: here, “ must be “, could not type as ‘ ‘

InnoDB table …………………. need explain

6.

CREATE TABLE secure_login.login_attemps (

-> `user_id` int(11) NOT NULL,

-> `time` VARCHAR(30) NOT NULL

-> ) ENGINE = InnoDB;

Query OK, 0 rows affected (0.11 sec)

7. Create a tester.

mysql> INSERT INTO secure_login.members VALUE(1, ‘test_kong’, ‘test@example.com’, ‘test1234′,’IamTester’, ‘oyeah’);

Query OK, 1 row affected (0.66 sec)

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s