Lesson 5.2. phpMyAdmin

Graphical interface

One of the keys to MySQL's success is its graphical interface phpMyAdmin which allows you to

This interface is developed in PHP and can easily be installed on a server. MySQL and phpMyAdmin are generally installed by default on most hosting or development environments.

MySQL queries are written in SQL which is a command line language that may seem austere at first. For a first use of MySQL, we are going to use phpMyAdmin. The latter displays the MySQL queries for each action performed in the graphical interface.

In general, access to the phpMyAdmin interface is done by the server address followed by phpMyAdmin: http://server_address/phpmyadmin. If you have installed a local server (like XAMPP). Your phpMyAdmin interface is generally accessible at one of these addresses: http://localhost/phpmyadmin or http://127.0.0.1/phpmyadmin.

If you do not have a phpMyAdmin installation on your server or your local machine, you can - as a last resort - perform the exercises on the demo interface of phpMyAdmin at this address: https://demo.phpmyadmin.net/master-config/ Please note that the databases are deleted and the privileges of users are reset at regular intervals. As a courtesy to others users, do not modify the content of databases that do not belong to you not.

Create database

In the interface of phpMyAdmin, create a new database:

Database creation in phpMyAdmin

The interface informs you that your database is empty (no table) and you suggests creating your first table.

Create your first table

In your database, create a stocks table that contains 4 columns. On the next page, define the fields of each column:

Create a new table in phpMyAdmin

Save and check the table:

New table stored in phpMyAdmin

Insert data

The table is created and ready to use.

Add a few lines into the table and observe the syntax of the SQL queries. Always leave the id field empty, it will automatically complete when creating a new row.

Table with rows in phpMyAdmin

See also


Last update : 03/10/2022