MySQL -Database Creation
Creating Database on MySQL is very simple. First, you need to download MySQL database for your computer and its operating system from MySQL official website. Install MySQL on your computer follow the installation steps while installing software. When installing it will ask you to download the requirement products like microsoft.net framework etc so install all those products. MySQL installation takes few minutes while installing it will ask you to create root password it is very important to create root password just do that step.
After installing MySQL workbench just use the password to log in. The below tutorial is completely based on MySQL workbench and normal cmd commends so try to do the installation of MySQL workbench on your computer then continue the tutorial.
Create MySQL Database
To create MySQL database You need an admin access so here we assume that you have root access You can create any database using queries or using UI of the workbench.
Steps to create a database without MySQL query:
- If you are using MySQL Workbench then follow the below steps to create any database but you need an admin access to create the database.
- Click on database option in the top menubar.
- Now it will ask you to enter the root password to connect to the database. So enter the root password which you created while installing MySQL.
- After enter password just clicks “OK” then you can see the default tables on the lefthand side of the screen like test and etc.
- Now you need to create a new database above the object browser you can see a schema option just click and it will ask you the name of the database to create just give whatever name you want.
- It will ask you to review the SQL statement just give ok that’s it now the new database created it will be added to the lefthand side database list.
Create MySQL database using Mysql Query:
Using this simple query, you can create any database just follow the steps clearly.
- From the lefthand menu of MySQL workbench select first option called create a new tab for executing queries.
- Now on the right-hand side, you will see the white screen in that type the below query simply.
- CREATE SCHEMA ‘Sampledatabase’ ;
- Here database name is “Sampledatabase”.
- To execute the query just select the query and click the execute query option in the top list or click f5.
- Now in the output screen, you can see the result of the query. If the query executed successfully then the green tick will come first.
- That’s it now you can see the created database in the top left database list.
This is the steps to create the database using MySQL Workbench.
If you want to create the database on cmd prompt just execute the below query comment
[[email protected]]# sqladmin -u root -p create sampledatabase
MySQL Database Create Query Values
|sampledatabase||- name of the database|
If you want to see the created database just type the below query.
In cmd, you can see all the databases you created using this query.
In the next post, I will guide you how to delete the database.