-
Notifications
You must be signed in to change notification settings - Fork 2
/
how to set up database.txt
executable file
·59 lines (45 loc) · 2.55 KB
/
how to set up database.txt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
step one:
Log onto mysql
$ mysql --user=root mysql
If root user has password, add -p and input it.
create new user called pollyUser, password polly
mysql> create user 'pollyUser'@'localhost' identified by 'polly';
mysql> grant all privileges on *.* to 'pollyUser'@'localhost' with grant option;
mysql> exit;
Log in as pollyUser to make sure you didn't mess up.
$ mysql -u pollyUser -p
password:*type the password*
Create the database, I'm lazy so we will call it test
mysql> create database test;
mysql> use test;
Create the table, THIS IS FOR VOTESMART API and EMAILS
mysql> create table vs_ID (id varchar(255), preferredName varchar(255), lastName varchar(255), birthDate varchar(255), birthPlace varchar(255), parties varchar(255), name varchar(255), title varchar(255), type varchar(255), status varchar(255), photo varchar(255));
If you type describe vs_ID; you get something like this
mysql> describe vs_ID;
+---------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| id | varchar(255) | YES | | NULL | |
| preferredName | varchar(255) | YES | | NULL | |
| lastName | varchar(255) | YES | | NULL | |
| birthDate | varchar(255) | YES | | NULL | |
| birthPlace | varchar(255) | YES | | NULL | |
| parties | varchar(255) | YES | | NULL | |
| name | varchar(255) | YES | | NULL | |
| title | varchar(255) | YES | | NULL | |
| type | varchar(255) | YES | | NULL | |
| status | varchar(255) | YES | | NULL | |
| photo | varchar(255) | YES | | NULL | |
+---------------+--------------+------+-----+---------+-------+
TO CREATE THE EMAIL TABLE
mysql> create table acc (ID int PRIMARY KEY auto_increment, email varchar(40), confirm Boolean);
to check the email table
mysql> describe acc;
+---------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| email | varchar(40) | YES | | NULL | |
| confirm | tinyint(1) | YES | | NULL | |
+---------+-------------+------+-----+---------+----------------+
CLOSE mysql