我很难做到这一点.
我在终端中创建了一个名为“somedb”的新数据库
CREATE DATABASE somedb
在我的桌面上,我有从PHPMyadmin下载的sql转储:somedb.sql
我试过了:
somedb < /Users/myname/Desktop/somedb.sql
MysqL -u myname -p -h localhost somedb </Users/myname/Desktop/somedb.sql
我已授予自己所有权限,但没有密码.
知道我做错了什么吗?
-- PHPMyAdmin sql Dump -- version 4.0.2 -- http://www.PHPmyadmin.net -- -- Host: localhost -- Generation Time: Jun 18,2013 at 02:22 PM -- Server version: 5.5.31-30.3 -- PHP Version: 5.2.17 SET sql_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `somedb` -- CREATE DATABASE IF NOT EXISTS `somedb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `somedb`; -- -------------------------------------------------------- -- -- Table structure for table `actions` -- CREATE TABLE IF NOT EXISTS `actions` ( `action_id` int(11) NOT NULL AUTO_INCREMENT,`action` varchar(75) NOT NULL,`qualifiers` text NOT NULL,`response` varchar(75) NOT NULL,`response_vars` text NOT NULL,`active` tinyint(4) NOT NULL,PRIMARY KEY (`action_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stores user defined actions triggered by certain events' AUTO_INCREMENT=3 ; -- -------------------------------------------------------- --