File: create_user_and_db.sql

package info (click to toggle)
opendb 0.62p9-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,544 kB
  • ctags: 3,560
  • sloc: php: 26,575; sql: 1,982; sh: 250; makefile: 54
file content (33 lines) | stat: -rw-r--r-- 1,279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# Script to create a new OpenDB 'lender' User and 'opendb' Database
#
# Execute at Mysql 'root' user:
# 	mysql -u root -p mysql < docs/create_user_and_db.sql
#
# USE THIS SCRIPT AT YOUR OWN RISK.  I WILL NOT BE HELD RESPONSIBLE
# Jason Pell - 3rd May 2003.
#

#
# Cteate a Opendb user 'lender', with password 'test'
#
INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv) 
VALUES ('localhost', 'lender', '378b243e220ca493', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');

#
# Configure permissions for 'lender' user for a database 'opendb'.  Access is limited to 'localhost', so
# the database server and Apache/PHP server must be on the same server.
# 
INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv) 
VALUES ('localhost', 'opendb', 'lender', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

#
# Create the 'opendb' database.
#
CREATE DATABASE opendb;

#
# Flush privileges so that the new user/db are recognised.
#
FLUSH PRIVILEGES;