Database BasicsCore· 25 min read

Setting Up MySQL & phpMyAdmin

Get a MySQL server running and a friendly visual tool to manage it.

What you will learn

  • Run MySQL (via XAMPP)
  • Use phpMyAdmin
  • Run your first query

The easy setup

If you installed XAMPP (a free bundle that runs a web server and database on your own computer) for PHP, you already have MySQL (the database server) and phpMyAdmin (a visual database manager you open in your web browser). No extra install needed.

  • Start MySQL in the XAMPP control panel.
  • Open http://localhost/phpmyadmin.
  • Create databases and tables with clicks, or run SQL in the SQL tab.

Step by step, here is exactly what you do the very first time, and what you should see:

  1. Open the XAMPP Control Panel and click Start next to MySQL. The label turns green when the database server is running.
  2. Open your web browser and go to http://localhost/phpmyadmin. The phpMyAdmin page loads, showing a list of databases down the left side.
  3. Click the SQL tab at the top — this gives you a big text box where you can type a query and press Go to run it.
  4. Type a tiny test query (below) and press Go to confirm everything works.

A safe first query just asks MySQL for its version number — it changes nothing, it only proves the connection works:

Your first query — ask MySQL its version
SELECT VERSION();

Note: Output: VERSION() 10.4.28-MariaDB (Your number will differ.) SELECT VERSION() asks the server to report which version it is running. Seeing any version number back means MySQL is up and phpMyAdmin can talk to it — you are ready to create a database.

Tip: phpMyAdmin lets you do everything visually AND see the SQL it generates — a great way to learn. MySQL Workbench is another popular tool.

Q. Which tool gives you a visual way to manage MySQL in XAMPP?

Answer: phpMyAdmin is a web-based visual manager for MySQL, included with XAMPP.

✍️ Practice

  1. Open phpMyAdmin and look around.
  2. Create a test database through the interface.

🏠 Homework

  1. Create a database named codingclave in phpMyAdmin.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →