phpMyAdmin“未选择数据库"MySQL

phpMyAdmin quot;No database selectedquot; MySQL(phpMyAdmin“未选择数据库MySQL)
本文介绍了phpMyAdmin“未选择数据库"MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一个 MySQL 备份文件并立即导入到 MAMP 的 phpMyAdmin.我懂了返回:

I downloaded a MySQL backup file and promptly imported into MAMP's phpMyAdmin. I got this return:

Error
SQL query: 

--
-- Database: `mysql`
--
-- --------------------------------------------------------
--
-- Table structure for table `columns_priv`
--
CREATE TABLE IF NOT EXISTS  `columns_priv` (

 `Host` CHAR( 60 ) COLLATE utf8_bin NOT NULL DEFAULT  '', 
 `Db` CHAR( 64 ) COLLATE utf8_bin NOT NULL DEFAULT  '',
 `User` CHAR( 16 ) COLLATE utf8_bin NOT NULL DEFAULT  '',
 `Table_name` CHAR( 64 ) COLLATE utf8_bin NOT NULL DEFAULT  '',
 `Column_name` CHAR( 64 ) COLLATE utf8_bin NOT NULL DEFAULT  '',
 `Timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
 `Column_priv` SET(  'Select',  'Insert',  'Update',  'References' ) CHARACTER SET utf8          NOT NULL DEFAULT  '',
PRIMARY KEY (  `Host` ,  `Db` ,  `User` ,  `Table_name` ,  `Column_name` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_bin COMMENT =  'Column      privileges';

MySQL said: 

#1046 - No database selected 

我根本没有更改 .sql 文件.关于如何让这只小狗在本地生活的任何提示?

I did not alter the .sql file at all. Any hints on how i can get this puppy going locally?

谢谢!

推荐答案

只需首先创建一个具有名称的数据库.单击该数据库,然后导入您的表.这里的问题是当您导入任何表时,它会查找您正在使用的数据库.所以,要么按照我上面说的做,要么在 CREATE TABLE IF NOT EXISTS columns_priv (

Just create a database with some name first of all. Click on that database and then import your table. The problem here is when you import any table it looks for which database you are using. So, either do as I said above or add this just above CREATE TABLE IF NOT EXISTS columns_priv (

USE your_db_name;//here your_db_name is the database you just created. 

就是这样.

这篇关于phpMyAdmin“未选择数据库"MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)