- Fork or clone the repo
- Open the project directory in any code editor
- Install Golang if not done so already at the following link: https://go.dev/doc/install
- Install MySQL by running "sudo apt install MySQL-server" on the terminal
- Check if MySQL is installed successfully by running "MySQL --version" to see the version number
- Start MySQL server by running "sudo /etc/init.d/MySQL start"
- To start using MySQL, run "sudo MySQL"
- To create a MySQL database called “internetforum”, run "create database internetforum;" at the MySQL command line (NOTE ALL COMMANDS BELOW until instruction 12 IS RUN ON THE MYSQL COMMAND LINE)
- Then, to use the created database, run "use internetforum;"
- Then, create a user called “user1” with password “Pas$w0rd” by running "create user 'user1'@'localhost' identified by 'Pas$w0rd';"
- Next to grant all privileges so that user1 can use the internetforum database, run the command "GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on . TO 'user1'@'localhost' WITH GRANT OPTION;"
- Next, exit mysql to log in as user1 by running "exit;"
- Login to user1 by running on the terminal "sudo mysql -u user1 -p" and type password 'Pas$w0rd'
- Use the created database by running "use internetforum;" on the MySQL command line.
- Run all the MySQL commands inside cvwo-backend/database/db.sql by copying and pasting all 5 commmands one by one to create all 5 necessary tables in the MySQL database "internetforum" or just simply run the command "source cvwo-backend/database/db.sql;" to create all 5 tables at ones.
- Next, after all 5 tables are created, type the following command in the terminal (make sure that the current directory is the project directory): “go run cmd/server/main.go".
- Backend and database is ready!
-
Notifications
You must be signed in to change notification settings - Fork 0
mingyang143/cvwo-backend
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published