mysql - 无法在 phpMyAdmin 中导入 MySQL 数据库

标签 mysql sql phpmyadmin

我在 phpMyAdmin 中导入数据库但出现错误。我尝试了太多但显示相同的错误,这里是 SQL 数据库:

CREATE TABLE `business` (
  `b_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `b_title` text,
  `b_lastmodified` datetime DEFAULT NULL,
  `b_detail` text,
  `b_banner_image` varchar(250) DEFAULT NULL,
  `b_cat_id` int(10) DEFAULT '100',
  `b_subcat_id` int(10) DEFAULT NULL,
  `b_tags` text,
  `b_user_id` bigint(20) DEFAULT NULL,
  `b_isactive` tinyint(1) DEFAULT '0' COMMENT 'admin will approve it',
  `b_created_on` datetime DEFAULT NULL,
  `b_views` bigint(20) DEFAULT '0' COMMENT 'number of times this is viewed',
  PRIMARY KEY (`b_id`)
) ENGINE=MyISAM AUTO_INCREMENT=764 DEFAULT CHARSET=utf8;

INSERT INTO `business` (`b_id`, `b_title`, `b_lastmodified`, `b_detail`, `b_banner_image`, `b_cat_id`, `b_subcat_id`, `b_tags`, `b_user_id`, `b_isactive`, `b_created_on`, `b_views`) VALUES ('1', 'Couple Names Silver Pendant', '2014-01-15 02:25:02', '', 'itm_couple-names-silver-pendant2013-03-25_22-07-16_1.jpg', '35', '0', 'love pendant,name pictures,silver name pendant,couple name pendant,locket of love,chain of name,fb display photos', '1', '1', '2013-03-25 22:06:53', '7263');

并显示这些错误:

Error
SQL query:

CREATE TABLE  `business` (

 `b_id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT ,
 `b_title` TEXT,
 `b_lastmodified` DATETIME DEFAULT NULL ,
 `b_detail` TEXT,
 `b_banner_image` VARCHAR( 250 ) DEFAULT NULL ,
 `b_cat_id` INT( 10 ) DEFAULT  '100',
 `b_subcat_id` INT( 10 ) DEFAULT NULL ,
 `b_tags` TEXT,
 `b_user_id` BIGINT( 20 ) DEFAULT NULL ,
 `b_isactive` TINYINT( 1 ) DEFAULT  '0' COMMENT  'admin will approve it',
 `b_created_on` DATETIME DEFAULT NULL ,
 `b_views` BIGINT( 20 ) DEFAULT  '0' COMMENT  'number of times this is viewed',
PRIMARY KEY (  `b_id` )
) ENGINE = MYISAM AUTO_INCREMENT =764 DEFAULT CHARSET = utf8;

MySQL said: Documentation

#1046 - No database selected

最佳答案

phpMyAdmin 中创建一个新数据库或选择一个现有数据库。然后导入 SQL 文件。

将以下行包含到您的 sql 脚本的第一行中。

create database database_name;
use database_name;

关于mysql - 无法在 phpMyAdmin 中导入 MySQL 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35312764/

相关文章:

MySQL order by count子查询

php - php无法连接数据库?

mysql - 自增不是从1开始

mysql计数并连接4个表

mysql - Struts 2 FreeMarker 模板错误 stack.findValue ('top' ) 未定义且 jsp 页面

mysql - 亚马逊网络服务 - 基本工作流程

SQL 连接加倍一些输出

Mysql,检查每一列的所有行是否具有相同的值

php - 在 Codeigniter 的连接查询中获取数组结果时出错

mysql - phpmyadmin WordPress 元键