Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[-]
Welcome
You have to register before you can post on our site.

Username:


Password:





[-]
Discord Widget

[-]
Twitter: SickGaming

[-]
Latest Threads
[Oracle Blog] Java on Container Like A P...
Last Post: xSicKxBot
Today 11:30 PM
» Replies: 0
» Views: 0
[Tut] Python | Split String After Delimi...
Last Post: xSicKxBot
Today 11:30 PM
» Replies: 0
» Views: 0
(Indie Deal) Monster Spark Bundle & Blac...
Last Post: xSicKxBot
Today 11:29 PM
» Replies: 0
» Views: 0
PC - Dying Light 2 Stay Human: Bloody Ti...
Last Post: xSicKxBot
Today 11:29 PM
» Replies: 0
» Views: 0
News - Apex Legends Mobile, Inscryption ...
Last Post: xSicKxBot
Today 11:29 PM
» Replies: 0
» Views: 0
[Oracle Blog] Java and the New Duke Pers...
Last Post: xSicKxBot
Today 04:54 AM
» Replies: 0
» Views: 4
[Tut] 3 Easy Habits That Can Make You Ri...
Last Post: xSicKxBot
Today 04:54 AM
» Replies: 0
» Views: 2
(Indie Deal) Vorax Development update #1
Last Post: xSicKxBot
Today 04:53 AM
» Replies: 0
» Views: 2
PC - Among Us VR
Last Post: xSicKxBot
Today 04:53 AM
» Replies: 0
» Views: 2
News - Best Team In NFL Plays GTA Online...
Last Post: xSicKxBot
Today 04:53 AM
» Replies: 0
» Views: 2

[Tut] phpMyAdmin – How to Create a Database?

#1
phpMyAdmin – How to Create a Database?

by Vincy. Last modified on November 22nd, 2022.

PHPMyAdmin is one of the widely used database clients for PHP MySQL developers. It provides a simple user interface that can be easily adapted by beginners.

We can blindly say that PHPMyAdmin as the de-facto database client used by PHP developers for MySQL / MariaDB. It is hugely popular and that is because of its simplicity and ease of use.

It allows many database operations. Example,

  1. Creating databases and the corresponding tables.
  2. Adding and managing data.
  3. Altering the existing structure and attributes defined.
  4. Import, and export operations.

In this article, we will see how to create a MySQL database using PHPMyAdmin.

How to create a database?


First login to the PHPMyAdmin client to go to the database control panel.

phpmyadmin login

After login, it redirects to the PHPMyAdmin control panel which allows doing the following.

  1. To manage and manipulate MySQL database assets.
  2. To perform CRUD or other database-related operations.

phpmyadmin create database

If you want to see code to perform the MySQL database CRUD operations from a PHP application, the linked article has the source,

Ways to create a database using PHPMyAdmin


There are 4 ways to create a new MySQL database using the PHPMyAdmin client interface.

  1. Via the left panel navigation.
  2. Via the header tab control navigation.
  3. By executing a CREATE statement via the SQL tab.
  4. By importing a CREATE statement SQL script via the Import tab.

1. Create database via left panel


In the PHPMyAdmin left panel, it contains a New link. It redirects to the page to create a new database.

2. Create database via header tab


The PHPMyAdmin UI shows tabs like Database, Import, Export and more. The Database tab redirects to show a list of existing databases with an option to create a new one.

Both of these navigation controls will display the UI as shown in the figure.

database create form

The database create-form shows two fields.

  1. To type the name of the database to be created.
  2. To choose a collation that is encoding type.

In the above screenshot, the utf8_unicode_ci collation is selected.

The other two methods are for the one who has the SQL script for creating a new MySQL database.

Sometimes the database SQL will be provided. In that case, it is not required to use the interface to input the database name and the collation.

3. Create database via SQL tab, by running a CREATE SQL query


Choose the SQL tab from the PHPMyAdmin header. It will show a textarea to paste the CREATE database query.

Then, execute the entered query to see the created database among the existing list.

phpmyadmin sql tab

4. Create database via Import tab, by uploading a SQL script


If you have the database CREATE statement Choose the Import tab from the PHPMyAdmin header. Then browse the SQL script that contains the CREATE statement.

Then click the “Go” button to process the import. It will result in displaying a new database imported.

phpmyadmin import database

We have seen PHP code for importing Excel data into a database using a custom code.

After creating a MySQL database


After creating a MySQL database using PHPMyAdmin, the next job is to start adding the tables.

The PHPMyAdmin has the option to “Check privileges” to map roles and MySQL database operations.

But, this is a rarely used feature. If the database is associated with more than one user, then this feature will be used.

How to create tables in a database?


After creating a database, the PHPMyAdmin shows a form to a create table. That form show fields to enter the table name and the number of columns of the table.

create database table

After specifying the table name and the “Number of columns”, the PHPMyAdmin panel will show inputs to add the table column specification.

See the following screen that is added with the column names with their corresponding types and more details.

create table column

Add user accounts and set privileges


Select the “User accounts” tab to see the number of existing user accounts. The PHPMyAdmin also allows adding a new user via the interface.

The “Create user” page will have the option to select the user account details and set the permission to perform operations like,

  • CRUD operations on the Data.
  • CREATE, ALTER, DROP and more operations on the MySQL database Structure.
  • Access Administration tools.
  • Setting resource limits like making the number of simultaneous connections.

See the screenshot below to allow or deny access permissions of the user created for a MySQL database.

create and set privileges

↑ Back to Top



https://www.sickgaming.net/blog/2022/11/...atabase-2/
Reply





Users browsing this thread:
1 Guest(s)

𝚂̷𝚒̷𝚌̷𝚔̷𝙶̷𝚊̷𝚖̷𝚒̷𝚗̷𝚐̷ 𝙷̷𝚘̷𝚖̷𝚎̷

Copyright © SickGaming.net 2022