0

when importing database, this is the error that occurs:

-- Database: `maha associates`
--

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

--
-- Table structure for table `wp_commentmeta`
--

CREATE TABLE `wp_commentmeta` (
  `meta_id` bigint(20) UNSIGNED NOT NULL,
  `comment_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
  `meta_key` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
  `meta_value` longtext COLLATE utf8mb4_unicode_520_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci
MySQL said: Documentation

1046 - No database selected

how do i solve that??

chris85
  • 23,846
  • 7
  • 34
  • 51
Derrick
  • 29
  • 1
  • 2

2 Answers2

1

Put this at the beginning of your file

USE yourdatabasename;

This defines the target database for mysql.

MatSnow
  • 7,357
  • 3
  • 19
  • 31
  • Yes it tells mysql to import it to the database "yourdatabasename" – MatSnow Sep 14 '17 at 13:07
  • it brings the same error but now with this line at the bottom: #1273 - Unknown collation: 'utf8mb4_unicode_520_ci' – Derrick Sep 14 '17 at 13:12
  • -- Table structure for table `wp_commentmeta` -- CREATE TABLE `wp_commentmeta` ( `meta_id` bigint(20) UNSIGNED NOT NULL, `comment_id` bigint(20) UNSIGNED NOT NULL DEFAULT '0', `meta_key` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL, `meta_value` longtext COLLATE utf8mb4_unicode_520_ci ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci MySQL said: Documentation #1273 - Unknown collation: 'utf8mb4_unicode_520_ci' – Derrick Sep 14 '17 at 13:17
  • For your second question have a look at this https://stackoverflow.com/questions/21190523/phpmysql-error-1273-1273-unknown-collation-utf8mb4-general-c – MatSnow Sep 14 '17 at 13:50
0

Wherever you did the export from, choose "Custom - display all possible options" Under "Format-specific options:" Under "Database system or older MySQL server to maximize output compatibility with:" Choose: MYSQL323