简体   繁体   English

phpmyadmin存储过程错误

[英]phpmyadmin stored procedure error

I am trying to run SP in phpmyadmin web-hosting server but always getting following error 我试图在phpmyadmin网站托管服务器中运行SP,但始终出现以下错误

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 near '' at line 4 检查与您的MySQL服务器版本相对应的手册以获取在第4行的''附近使用的正确语法

SP I am trying to run is: 我要运行的SP是:

CREATE PROCEDURE Authenticate_UserByEmailID(strUsername VARCHAR(45), strPassword VARCHAR(45))
BEGIN
    SELECT * FROM users 
    WHERE users.Username = strUsername AND users.Password = strPassword;
END $$

I tried putting single quotes in SP name, table name columns name and different other combinations with quotes but no result then I came across this link and tried changing delimiter but no result. 我尝试在SP名称,表名称列名称和其他带有引号的其他组合中加上单引号,但没有结果,然后我遇到了此链接,并尝试更改定界符但没有结果。 can you please help on this. 你能帮忙吗?

Solution: 解:

Sorry guys my bad. 抱歉,我不好。 I added delimiter which solved the problem for me. 我添加了定界符,它为我解决了这个问题。

DELIMITER ;;

CREATE PROCEDURE `Authenticate_UserByEmailID`(strUsername VARCHAR(45), strPassword VARCHAR(45))
BEGIN
    SELECT * FROM DBCompany_samsonusac517644.users 
    WHERE Username = strUsername AND Password = strPassword;
END ;;

you miss the DELIMITER 您错过了DELIMITER

mysql> delimiter $$
mysql> CREATE PROCEDURE Authenticate_UserByEmailID(strUsername VARCHAR(45), strPassword VARCHAR(45))
    -> BEGIN
    ->     SELECT * FROM users 
    ->     WHERE users.Username = strUsername AND users.Password = strPassword;
    -> END $$
Query OK, 0 rows affected (0.01 sec)

All the answers above are making certain assumptions. 以上所有答案均做出某些假设。 There are basic problems in 1and1 and certain other hosting providers are using phpMyAdmin versions which are very old and have an issue that defined delimiter is ; 1and1中存在一些基本问题,某些其他托管服务提供商正在使用phpMyAdmin版本,这些版本非常旧,并且存在定义的定界符为的问题; and there is no way to change it from phpMyAdmin. 并且没有办法从phpMyAdmin进行更改。 Some of the providers have moved on so they will not face this problem. 一些提供程序已经继续前进,因此他们将不会遇到此问题。 but if you do then following are the ways - 但如果您这样做,则可以按照以下方式进行操作-

  1. Create a new PHPMyAdmin on the hosting provider. 在托管提供程序上创建一个新的PHPMyAdmin。 Attached link gives you idea http://internetbandaid.com/2009/04/05/install-phpmyadmin-on-1and1/ 附件链接为您提供了想法http://internetbandaid.com/2009/04/05/install-phpmyadmin-on-1and1/
  2. Go thru the complicated route of be able to access the your hosting providers mySQL from your dekstop. 通过复杂的途径,可以从您的dekstop访问托管服务提供商mySQL。 It is complicated but the best if you are a serious developer. 如果您是一个认真的开发人员,这很复杂,但是最好。 here is a link to do it http://franklinstrube.com/blog/remote-mysql-administration-for-1and1/ 这是执行此操作的链接http://franklinstrube.com/blog/remote-mysql-administration-for-1and1/

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM