I'm struggling to do this.
I have created a new database in the terminal called "somedb" using
CREATE DATABASE somedb
On my desktop I have the SQL dump downloaded from phpMyadmin: somedb.sql
I have tried:
somedb < /Users/myname/Desktop/somedb.sql
Result: ERROR 1064 (42000): You have an error in your SQL syntax
mysql -u myname -p -h localhost somedb </Users/myname/Desktop/somedb.sql
Result: ERROR 1064 (42000): You have an error in your SQL syntax;
I'm new to SQL (The purpose of importing this db is for a text book exercise)
I have granted myself all privileges and there is no password.
Any idea what I'm doing wrong?
Here is the top of the SQL dump file:
-- 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 ;
-- --------------------------------------------------------
--