Title: Error (SQL query) while importing database in Php My Admin
Last modified: April 17, 2018

---

# Error (SQL query) while importing database in Php My Admin

 *  Resolved [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/)
 * Hi,
    I faced an error (SQL query) while importing database in PHP My Admin. Any
   recommendation?
 * See here:
    [https://image.ibb.co/hNGkHS/Untitled.png](https://image.ibb.co/hNGkHS/Untitled.png)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Piotro](https://wordpress.org/support/users/piotrpomorski/)
 * (@piotrpomorski)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189237)
 * refresh phpMyAdmin and check again base uni.
    For me, this query has gone through
   without a hitch or delete base and try again:
 *     ```
       CREATE TABLE <code>wp_commentmeta</code> 
       (<code>meta_id</code> bigint(20) UNSIGNED NOT NULL,
           <code>comment_id</code> bigint(20) UNSIGNED NOT NULL DEFAULT '0',
           <code>meta_key</code> varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
           <code>meta_value</code> longtext COLLATE utf8mb4_unicode_ci)
           ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
       ```
   
    -  This reply was modified 8 years, 1 month ago by [Piotro](https://wordpress.org/support/users/piotrpomorski/).
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189265)
 * Thanks Piotro (@piotrpomorski),
    I’ve tried many times as you told me, but the
   same problem is happening 🙁
    -  This reply was modified 8 years, 1 month ago by [hamadesign](https://wordpress.org/support/users/hamadesign/).
 *  [Piotro](https://wordpress.org/support/users/piotrpomorski/)
 * (@piotrpomorski)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189311)
 * base uni is empty?
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189354)
 * Yes it’s empty
 *  [helldog2018](https://wordpress.org/support/users/helldog2018/)
 * (@helldog2018)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189525)
 * Hi [@hamadesign](https://wordpress.org/support/users/hamadesign/),
 * If you export your database make sure your “Add DROP TABLE / VIEW / PROCEDURE/
   FUNCTION” is enabled.
    This will make sure the table is dropped first before 
   importing the new one.
 * Let me know if this solved your issue.
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189862)
 * Thanks helldog2018 (@helldog2018),
 * I really don’t have an idea what is “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION”
   and how to do that.
 * As I said earlier, my database “uni”, which I wanted to import to, is empty.
 *  [helldog2018](https://wordpress.org/support/users/helldog2018/)
 * (@helldog2018)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189942)
 * Hi [@hamadesign](https://wordpress.org/support/users/hamadesign/),
 * I suppose you installed a new WordPress, eventhough it is a complete new and 
   clean install, it will place tables (empty ones) inside your database.
 * What I am proposing is to enable the function to delete already existing tables
   if the tablename is exactly the same (in this case wp_commentmeta).
 * What you can also try to do is manually remove the empty wp_commentmeta table
   and then import your database inside the new one. Then it atleast can’t tell 
   you that this table already exists.
 * It will probably then come with the same issue, only then for the wp_comments
   table. Because the wp_commentsmeta table is the first table being created after
   WordPress install (check [THIS](https://codex.wordpress.org/Database_Description)).
 * Let me know if this fixed your problem.
    -  This reply was modified 8 years, 1 month ago by [helldog2018](https://wordpress.org/support/users/helldog2018/).
 *  [helldog2018](https://wordpress.org/support/users/helldog2018/)
 * (@helldog2018)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10189975)
 * Also check [THIS](https://mediatemple.net/community/products/dv/204403864/export-and-import-mysql-databases)
   page to learn how to activate ‘drop table if exists’ when you are firstly exporting
   your database.
    This newly exported database should be imported inside your new
   database.
    -  This reply was modified 8 years, 1 month ago by [helldog2018](https://wordpress.org/support/users/helldog2018/).
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190138)
 * Again, thanks very much helldog2018 (@helldog2018).
 * I’ve tried to export the original database without the table “wp_commentmeta”.
 * When I tried to upload the database to the new one, I got this message:
 * > “You probably tried to upload a file that is too large. Please refer to documentation
   > for a workaround for this limit”.
 * What a problem!
 *  [helldog2018](https://wordpress.org/support/users/helldog2018/)
 * (@helldog2018)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190247)
 * Hi [@hamadesign](https://wordpress.org/support/users/hamadesign/),
 * This is due to php settings, they restrict to a certain size.
    Add the following
   to your .htaccess
 *     ```
       php_value upload_max_filesize 120M //file size
       php_value post_max_size 120M
       php_value max_execution_time 200
       php_value max_input_time 200
       ```
   
 * Then try to import the database again.
    If succesfull remove the code again.
 * Cheers.
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190661)
 * I really appreciate your great help helldog2018 (@helldog2018).
 * Thank you isn’t enough. If there is a better way to thank you, kindly tell me
   🙂
 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190678)
 * First, this database cannot be imported into one that already contains WordPress
   tables with the default `wp_` table prefix. Please create a new database in phpMyAdmin,
   and then import your old database into the one you just created.
 * Second, modern Apache installations do not load PHP as a shared object, they 
   use a FastCGI handler such as PHP-FPM. If this is the case here, then adding 
   those values in .htaccess will result in HTTP 500 errors and blank pages.
 *  Thread Starter [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * (@hamadesign)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190755)
 * Thank you DionDesigns (@diondesigns).
 * I did that before. I’ve created a new database in phpMyAdmin and then imported
   the old database into the one you I created.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Error (SQL query) while importing database in Php My Admin’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 4 participants
 * Last reply from: [hamadesign](https://wordpress.org/support/users/hamadesign/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/error-sql-query-while-importing-database-in-php-my-admin/#post-10190755)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
