Where to find Magento database

Where to find Magento database

August 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Where to find Magento database

Accessing Your Magento Database: A Comprehensive Guide

I understand that you’re looking to access your Magento database for some housekeeping - deleting old orders, customers, etc. This is a common task for developers and store administrators alike. Let me walk you through the process step-by-step.

Understanding Your Database Credentials

You’ve mentioned finding your credentials in local.xml. That’s great! The file usually looks something like this:

<config>
    <global>
        <install date="Fri Mar 13 00:00:00 UTC 2020">
            <version_id>2.4.0</version_id>
        </install>
        <resources>
            <default setup="default">
                <connection>
                    <adapter>mysql</adapter>
                    <host><![CDATA[localhost]]></host>
                    <dbname><![CDATA[magentodb]]></dbname>
                    <user><![CDATA[magento_user]]></user>
                    <password><![CDATA[secret_password]]></password>
                </connection>
            </default>
        </resources>
    </global>
</config>

Here, localhost, magentodb, magento_user, and secret_password are your database host, name, username, and password respectively.

Accessing the Database

Now that you have your credentials, let’s connect to the database. The easiest way is through phpMyAdmin, which is a web-based interface for MySQL databases.

  1. Find Your phpMyAdmin URL The default url format is http://<your-domain>/phpmyadmin. So if your domain is example.com, you’d access it at http://example.com/phpmyadmin.

  2. Log In Enter the database username and password from your credentials into the respective fields in phpMyAdmin.

  3. Select Your Database Once logged in, you’ll see a list of databases on the left-hand side. Find the one corresponding to your Magento installation (usually something like magentodb) and click it.

Deleting Records

To delete all orders or customers, follow these steps:

  • Click the “SQL” tab at the top.
  • Run the following MySQL queries:
    • To delete all orders: DELETE FROM sales_order;
    • To delete all customers: DELETE FROM customer_entity;

These queries will remove all records from the specified tables.

Best Practices

Remember, deleting data directly from the database should be done with extreme caution. Always backup your data before performing such operations to avoid any accidental loss of information.

If you’re looking for a more controlled way of handling this, consider using Magento’s built-in functionality or a third-party extension like [https://laravelcompany.com/magento-extensions/] which offers advanced tools for database management and cleanup tasks.

Conclusion

Accessing your Magento database is straightforward once you know where to look. With the right credentials and phpMyAdmin access, you can perform essential maintenance operations like deleting old orders or customers.

I recommend bookmarking this guide for future reference when you need to interact with your Magento database. If you have any other questions or need further assistance, feel free to reach out!

Database Admin Configuration Orders

Our network