Prior to setting up your uKnowva database, it is essential that you have a ready, created database that you can connect. This article outlines the steps involved in creating a database using phpMyAdmin and Command Line.
Creating a Database using phpMyAdmin:
- Log in to your instance of phpMyAdmin
- In the landing page, you will see an option to create a new database. Enter the name that you would like to give your database and click Create. Once the database is created, it will be displayed in the list on the left side.
- Once you database is created, click on the name in the left side and then click on the Privileges tab.
- In this tab, click on Add a New User.
- Enter the Username, Password and Host for the new user.
- When you scroll down the page you will see options for granting privileges to the user. Here, you can provide either all privileges or limited privileges to the user.
- To provide all privileges, select “Grant all privileges on database “db_name”,” click “Check All” and then click “Go.”
- To provide limited privileges, select “Grant all privileges on database “db_name”,” select the boxes that you need to and then click “Go.”
Creating a Database using Command Line:
- Log in to MySOL using the following commands:
user@server:~$ mysql -u mysql_user -p
Enter password: - Now you can create your database by typing the following command:
mysql > create database db_name;
- To verify that your table has been created, use the following command:
mysql > show databases;
- Next, you create a new user:
mysql > create user db_user;
- You can grant privileges to the user when assigning the password for this account.
- The following command provides all privileges to the user:
mysql > grant all on db_name.* to 'db_user'@'localhost' identified by 'db_password';
- To provide limited privileges, choose the privileges that apply and separate by comma, as shown:
mysql > grant select, insert, delete on db_name.* to 'db_user'@'localhost' identified by 'db_password';