gpt4 book ai didi

MySQL 错误 1064 - 正确的语法?

转载 作者:行者123 更新时间:2023-11-29 04:47:57 25 4
gpt4 key购买 nike

我是 MySQL 的新手,所以在您决定对此投反对票之前,请添加评论,我会删除该帖子。我正在关注关于 android-hive 的教程,http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ ,它使用 MySQL 作为保存用户信息的数据库。我在 AWS EC2 Linux 实例上设置了 MySQL,以及 apache tomcat 等。教程说:

Open your mysql console or phpmyadmin and run following query to create database 
and users table:

create database android_api /** Creating Database **/

use android_api /** Selecting Database **/

create table users(
uid int(11) primary key auto_increment,
unique_id varchar(23) not null unique,
name varchar(50) not null,
email varchar(100) not null unique,
encrypted_password varchar(80) not null,
salt varchar(10) not null,
created_at datetime,
updated_at datetime null
); /** Creating Users Table **/

我通过 SSH 连接到我的 Linux 实例并启动 MySQL 并运行教程中所述的查询。我收到以下错误:

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
'use android_api
create table users(
uid int(11) primary key auto_increment,
' at line 3

我真的不知道如何解决这个问题,感谢您提供的任何帮助,感谢您抽出宝贵时间。

最佳答案

您好像漏掉了语句分隔符。尝试使用“;”在每个查询的末尾。

关于MySQL 错误 1064 - 正确的语法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15995326/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com