子非鱼丶

只要抱着良好的愿望演奏,演员的演技可以不予苛求。

自己遇到的Mysql错误(初学)

1.复制时需要把->去掉 不然会报错

mysql> CREATE PROCEDURE s_insert(IN id int,IN name VARCHAR(20),IN count int)
   BEGIN
    SET @id=id;
    SET @name =name;
    SET @count=count;
    SET @insertSql =CONCAT('insert into store values(?,?,?)');
    PREPARE stmtinsert FROM @insertSql;
    EXECUTE stmtinsert USING @id,@name,@count;
    DEALLOCATE PREPARE stmtinsert;
    END;
Query OK, 0 rows affected

mysql> CREATE PROCEDURE s_insert(IN id int,IN name VARCHAR(20),IN count int)
   BEGIN
    ->SET @id=id;
    ->SET @name =name;
    ->SET @count=count;
    ->SET @insertSql =CONCAT('insert into store values(?,?,?)');
    ->PREPARE stmtinsert FROM @insertSql;
    ->EXECUTE stmtinsert USING @id,@name,@count;
    ->DEALLOCATE PREPARE stmtinsert;
    ->END;
1064 - 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 '->SET @id=id;
    ->SET @name =name;
    ->SET @count=count;
    ->SET @inser' at line 3

2.

表名,字段名,存储过程等 打‘引号’不是英文输入下的‘’
英文下的单引号是用来包含字符串或者字符的
会报错 不知道是怎么打出来的`

DROP PROCEDURE IF EXISTS `P_GET_CLASS_NAME`;
 store | CREATE TABLE `store` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `count` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 |
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33366229/article/details/74754336
文章标签: mysql
个人分类: Mysql
想对作者说点什么? 我来说一句

mysql错误can't open file

2013年07月09日 64KB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭