Description:
fixed database creation instructions in installer script. patch by Witchakorn Kamolpornwijit
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r97:b344db59d967 - - 1 file changed: 2 inserted, 2 deleted
@@ -24,50 +24,50 | |||||
|
24 |
|
24 | ||
|
25 | echo "Configuring rails app" |
|
25 | echo "Configuring rails app" |
|
26 |
|
26 | ||
|
27 | cp web/config/environment.rb.SAMPLE web/config/environment.rb |
|
27 | cp web/config/environment.rb.SAMPLE web/config/environment.rb |
|
28 |
|
28 | ||
|
29 | echo "At this point we will need MySQL user and database." |
|
29 | echo "At this point we will need MySQL user and database." |
|
30 | echo "Have you created MySQL user and database for Cafe grader? (Y/N) " |
|
30 | echo "Have you created MySQL user and database for Cafe grader? (Y/N) " |
|
31 | read ch |
|
31 | read ch |
|
32 |
|
32 | ||
|
33 | if [ "$ch" = "n" -o "$ch" = "N" ] |
|
33 | if [ "$ch" = "n" -o "$ch" = "N" ] |
|
34 | then |
|
34 | then |
|
35 | echo "Please open another terminal and create the user and database for Cafe grader." |
|
35 | echo "Please open another terminal and create the user and database for Cafe grader." |
|
36 | echo "Don't forget to grant access to that database for the user." |
|
36 | echo "Don't forget to grant access to that database for the user." |
|
37 | echo "Please have username, password, and database name ready before continue." |
|
37 | echo "Please have username, password, and database name ready before continue." |
|
38 | echo |
|
38 | echo |
|
39 | echo "The following are instructions:" |
|
39 | echo "The following are instructions:" |
|
40 | echo "1. Run mysql:" |
|
40 | echo "1. Run mysql:" |
|
41 | echo |
|
41 | echo |
|
42 | echo " mysql -u root -p" |
|
42 | echo " mysql -u root -p" |
|
43 | echo |
|
43 | echo |
|
44 | echo " if you have just installed mysql, the root password is the one that you have just entered" |
|
44 | echo " if you have just installed mysql, the root password is the one that you have just entered" |
|
45 | echo "2. Create a new database, a new user, and grant access to grader database:" |
|
45 | echo "2. Create a new database, a new user, and grant access to grader database:" |
|
46 | echo |
|
46 | echo |
|
47 | echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';" |
|
47 | echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';" |
|
48 | - echo " create database DATABASENEME;" |
|
48 | + echo " create database \`DATABASENEME\`;" |
|
49 | - echo " grant all on DATABASENAME.* to 'USERNAME'@'localhost';" |
|
49 | + echo " grant all on \`DATABASENAME\`.* to 'USERNAME'@'localhost';" |
|
50 | echo |
|
50 | echo |
|
51 | echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly." |
|
51 | echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly." |
|
52 | echo |
|
52 | echo |
|
53 | echo "Hit enter when ready..." |
|
53 | echo "Hit enter when ready..." |
|
54 | read dummy |
|
54 | read dummy |
|
55 | fi |
|
55 | fi |
|
56 |
|
56 | ||
|
57 | CAFE_PATH=`pwd` |
|
57 | CAFE_PATH=`pwd` |
|
58 |
|
58 | ||
|
59 | cd web |
|
59 | cd web |
|
60 |
|
60 | ||
|
61 | echo "Please provide grader database:" |
|
61 | echo "Please provide grader database:" |
|
62 | read database |
|
62 | read database |
|
63 |
|
63 | ||
|
64 | echo "Please provide grader username:" |
|
64 | echo "Please provide grader username:" |
|
65 | read username |
|
65 | read username |
|
66 |
|
66 | ||
|
67 | echo "Please provide $username password:" |
|
67 | echo "Please provide $username password:" |
|
68 | read password |
|
68 | read password |
|
69 |
|
69 | ||
|
70 | echo "development:" > config/database.yml |
|
70 | echo "development:" > config/database.yml |
|
71 | echo " adapter: mysql" >> config/database.yml |
|
71 | echo " adapter: mysql" >> config/database.yml |
|
72 | echo " database: $database" >> config/database.yml |
|
72 | echo " database: $database" >> config/database.yml |
|
73 | echo " username: $username" >> config/database.yml |
|
73 | echo " username: $username" >> config/database.yml |
You need to be logged in to leave comments.
Login now