Page 1 of 1

MySQL database import error

PostPosted: 19. January 2018 06:14
by manitamang
Hello,

I just formatted my computer and installed Windows 7 as same as before formatting my computer. And installed XAMPP Control Panel v3.2.2
After installing Xampp I tried to import MySQL database (which was export before formatting computer) I am getting this error.

SQL query:

--
-- Database: `adventuresolu`
--

-- --------------------------------------------------------

--
-- Table structure for table `as_apmm_custom_theme`
--

CREATE TABLE `as_apmm_custom_theme` (
`theme_id` int(11) NOT NULL,
`title` text,
`slug` text,
`theme_settings` longtext,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4


MySQL said: Documentation
#1046 - No database selected

Can anybody help me please?

Thank you.

Re: MySQL database import error

PostPosted: 19. January 2018 11:56
by Nobbie
You did not select a database (as the error says). Select any database before you start you import. If there is no database, create one.

Re: MySQL database import error

PostPosted: 21. January 2018 11:57
by manitamang
Hello Nobbie,

Thank you for your reply. But I have tried many times to import after selecting database.

The XAMPP was working before formatting my computer. But it is getting after reinstalling windows & Xampp. Can you help me why this error is getting?

Thank you.

Re: MySQL database import error

PostPosted: 21. January 2018 16:54
by Nobbie
manitamang wrote:Can you help me why this error is getting?


Because you did not specify the database in your export file, when you created it. There are tons of options for the export, and it is up to you which one to use. Obviously, you exported the database 'adventuresolu', but you did not include the corresponding code for the export file, in order to create that database automatically, it it does not exist. You only exported all tables and tablenames, including the code for automatically creating tables, if they do not exist. Therefore you have to create manually that database and choose it as target database, before you start to import your data. Thats all.