#1046 – No database selected error in phpMyAdmin, fix just in 4 steps

Key Takeaways & Quick Summary
  • Verified Guide: Step-by-step instructions tested and verified by Techniq World editors.
  • Prerequisites & Commands: Includes executable terminal commands formatted for modern OS environments.
  • Reliable & Safe: Adheres to current security guidelines and best technical practices.

When we are working on a database, then sometimes we get to see an error which is – ” # 1046 – No Database Selected ” .

This error appears when we are going to create a table in the database, or when we are recovering the tables from our backups.

Solution:

If you see this error, then you can fix this error by following the steps given below :

For phpMyAdmin:- #1046 database not selected

# 1046 - Database Not Selected - create database
Fig: Create database

1. If you want to import tables from database backups and you are working on phpMyAdmin then first you need to create a new database.

#1046 - database not selected - import
Fig: import table

2. After creating the database, you have to select that database. At the top right you will see some tabs. You have to click the Import tab.

#1046 - database not selected - import table
Fig: import and select file

3. And inside the Import tab, you will see a browse button. Click that button.

4. After that a new window will open from which you can select your database backup file and at the end of the page you will see the Go button click on that. Your database error will be removed.

For MySQL Server:- 

  • On the other hand, if you are working on MySQL server then before creating table you have to choose database. For this, you can use following command :

    use  Database_Name;

  • After selecting database, then you can create any table or import table from database backup file.
Techniq World
Verified Technical Author

Written by Techniq World

Technology specialist and technical writer at Techniq World, covering modern software, operating systems, and developer tools.

Leave a Reply

FREE WEEKLY TECH DIGEST

Level Up Your Tech & Troubleshooting Skills

Join 18,500+ developers, system engineers, and tech pros. Get concise, actionable guides on software development, Windows/Mac optimization, security fixes, and hardware reviews delivered to your inbox every Thursday.

Zero spam guaranteed 100% Privacy protected Instant one-click unsubscribe