首页 > 技术文章 > Django中创建数据库报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=utf8' at line 1解决方案

lxmtx 2020-07-18 08:35 原文

一、问题描述

  Django中执行create database charset=utf8;命令报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=utf8' at line 1

 

二、问题原因

  数据库名称没有用反引号引起来

三、解决方案

  创建数据库时使用以下命令即可:

    create ' database' charset=utf8;

    

 

推荐阅读