[英]Importing mysql database into phpmyadmin #1064
I'm having a error when I try to import wordpress database into phpmyadmin. 尝试将wordpress数据库导入phpmyadmin时出现错误。 Error msg
错误味精
-- -- Databas:
133425-admin
-- USE 133425 - admin;--数据库:
133425-admin
使用133425-admin;MySQL sa: Dokumentation
MySQL sa:文档编辑
1064 - You have an error in your SQL syntax;
1064-您的SQL语法有误; check the manual that corresponds to your MySQL server version for the right syntax to use
查看与您的MySQL服务器版本相对应的手册以使用正确的语法
near '133425-admin' at line 4
第4行的“ 133425-admin”附近
And the first line in the .sql file is .sql文件的第一行是
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Värd: 127.0.0.1
-- Tid vid skapande: 04 nov 2016 kl 08:56
-- Serverversion: 10.1.16-MariaDB
-- PHP-version: 5.6.24
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 utf8mb4 */;
--
-- Databas: `133425-admin`
--
USE 133425-admin;
-- --------------------------------------------------------
--
-- Tabellstruktur `django_migrations`
--
CREATE TABLE `django_migrations` (
`id` int(11) NOT NULL,
`app` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The only thing that have changes from my old database to this one is the name 133425-admin so I added USE 133425-admin; 从我的旧数据库更改为该数据库的唯一一件事是名称133425-admin,因此我添加了USE 133425-admin。 When importing the .sql file into a database named the same as before it is successfull.
将.sql文件导入与成功之前相同名称的数据库中。
Is the USE.... line wrong? USE ....线路错误吗?
Here's a screenshot of the problem: 这是问题的屏幕截图:
Better to try import via command line, here is the example : 最好尝试通过命令行导入,这是示例:
mysql -u username -p database_name < file.sql
Before you import, make sure you create the empty database name. 导入之前,请确保创建空数据库名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.