-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refine the findOne method and add the sql file
- Loading branch information
Harry Sun
committed
Feb 29, 2016
1 parent
5a60077
commit 3b08a5f
Showing
2 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*创建新用户*/ | ||
CREATE USER jun@localhost IDENTIFIED BY 'jun'; | ||
|
||
/*用户授权 授权jun用户拥有sf数据库的所有权限*/ | ||
GRANT ALL PRIVILEGES ON sf.* TO jun@'%' IDENTIFIED BY 'jun'; | ||
|
||
/*刷新授权*/ | ||
FLUSH PRIVILEGES; | ||
|
||
/*创建数据库*/ | ||
CREATE DATABASE IF NOT EXISTS `sf`; | ||
|
||
/*选择数据库*/ | ||
USE `sf`; | ||
|
||
/*创建表*/ | ||
CREATE TABLE IF NOT EXISTS `user` ( | ||
id INT(20) NOT NULL AUTO_INCREMENT, | ||
name VARCHAR(50), | ||
age INT(11), | ||
PRIMARY KEY(id) | ||
); | ||
|
||
/*插入测试数据*/ | ||
INSERT INTO `user` (name, age) VALUES('harry', 20), ('tony', 23), ('tom', 24); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters