mysql-error-1064

ERROR 1064 (42000) in MySQL

谁说我不能喝 提交于 2019-11-30 04:13:44
I am trying to populate a new MySQL empty database with a db dump created from MS SQL Azure database, and I get the following error ERROR 1064 (42000) at line 1: 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 'I ' at line 1 I used mysqldump to perform this operation and used command similar to the following in the command prompt: mysql --user=rootusername --pasword=password databasename < dumpfilename.sql Mysqldump took about 30 minutes to display this error message. (For those coming to this question from a

SHOW TABLES statement with multiple LIKE values

空扰寡人 提交于 2019-11-29 22:56:17
mysql> SHOW TABLES like 'cms'; +-------------------------+ | Tables_in_tianyan (cms) | +-------------------------+ | cms | +-------------------------+ 1 row in set (0.00 sec) Result mysql> SHOW TABLES like 'cms' or like 'role'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual... How can I filter by multiple conditions ? You need to use the WHERE clause. As shown in the docs , you can only have a single pattern if you use "SHOW TABLES LIKE ..." , but you can use an expression in the WHERE clause if you use "SHOW TABLES WHERE ..." . Since you want an expression, you

Using Cursor in a Loop of a stored procedure

流过昼夜 提交于 2019-11-29 07:13:50
So as to use cursors dynamically using MySQL is it possible to declare a cursor in a loop of a stored procedure? I've tried and got an error: increment: LOOP DECLARE cur1 CURSOR FOR SELECT person_id, publication_id FROM p_publication WHERE person_id = new_count; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; OPEN cur1; REPEAT FETCH cur1 INTO pub_id, per_id; IF NOT done THEN INSERT INTO test.t2 VALUES (pub_id, per_id); END IF; SET new_count = new_count + 1; UNTIL done END REPEAT; CLOSE cur1; IF !(new_count < old_count ) THEN LEAVE increment; END IF; END LOOP increment; You have an error

Mysql function returning a value from a query

岁酱吖の 提交于 2019-11-29 03:39:11
i want to create a function which calculates a value using a query and I am having a problem returning the value: Shortened, my query is: CREATE FUNCTION func01(value1 INT , monto DECIMAL (10,2)) RETURNS DECIMAL(10,2) BEGIN SET @var_name = 0; select @var_name=if(value1 = 1,monto * table.divisa_dolar,table.monto *divisa_euro) from table where data_init = 1; return @var_nam; END I get a SQL syntax error. SQL Error (1064): You have an error in your SQL syntax; theChrisKent Assuming these are all generic names (table will not be a good table name), the problem is you can't use == for comparison.

ERROR 1064 (42000) in MySQL

不羁的心 提交于 2019-11-29 01:01:30
问题 I am trying to populate a new MySQL empty database with a db dump created from MS SQL Azure database, and I get the following error ERROR 1064 (42000) at line 1: 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 'I ' at line 1 I used mysqldump to perform this operation and used command similar to the following in the command prompt: mysql --user=rootusername --pasword=password databasename < dumpfilename.sql

Table 'performance_schema.session_variables' doesn't exist

独自空忆成欢 提交于 2019-11-28 23:46:56
I m new at using MySql data base, i have downloaded EasyPHP-Devserver-16.1, when I run my server to update my data base schema this error message shows up. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'performance_schema.session_variables' doesn't exist I know that the problem is not in my spring configuration file but in mysql server. public class Configurations { protected static final String PROPERTY_NAME_DATABASE_DRIVER = "com.mysql.jdbc.Driver"; protected static final String PROPERTY_NAME_DATABASE_PASSWORD = ""; protected static final String PROPERTY_NAME_DATABASE_URL

SHOW TABLES statement with multiple LIKE values

一曲冷凌霜 提交于 2019-11-28 19:49:55
问题 mysql> SHOW TABLES like 'cms'; +-------------------------+ | Tables_in_tianyan (cms) | +-------------------------+ | cms | +-------------------------+ 1 row in set (0.00 sec) Result mysql> SHOW TABLES like 'cms' or like 'role'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual... How can I filter by multiple conditions ? 回答1: You need to use the WHERE clause. As shown in the docs, you can only have a single pattern if you use "SHOW TABLES LIKE ..." , but you can use

mysql is not recognised as an internal or external command,operable program or batch

人走茶凉 提交于 2019-11-28 17:09:43
I had set the MySQL path, but still getting the same error. Please let me know whether I followed the correct one or not. MySQL location is: C:\Program Files\MySQL\MySQL Server 5.0\bin In Windows, system variables I had set the path as: variable name: MYSQL_HOME variable value: C:\Program Files\MySQL\MySQL Server 5.0\bin For PATH setting: variable name: PATH variable value: .;%JAVA_HOME%\bin;%MYSQL_HOME%\bin... If it is not the correct one, please let me know the correct path and its settings. David Fells MYSQL_HOME variable value:C:\Program Files\MySQL\MySQL Server 5.0\bin %MYSQL_HOME%\bin

Mysql syntax error creating stored procedure

删除回忆录丶 提交于 2019-11-28 14:33:19
This is driving me nuts. CREATE DEFINER=`root`@`localhost` PROCEDURE `CalcularCRTarea` (Id_Tarea INT, OUT crTarea decimal(12, 4)) DETERMINISTIC BEGIN DECLARE done BOOLEAN DEFAULT FALSE; DECLARE _id BIGINT UNSIGNED; DECLARE cur CURSOR FOR SELECT Id FROM Tarea_Frente where Id_Item_Tarea = Id_Tarea; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done := TRUE; OPEN cur; testLoop: LOOP FETCH cur INTO _id; IF done THEN LEAVE testLoop; ELSE CALL CalcularCRFrente(_id, @suma); SET crTarea = crTarea + @suma; END IF; END LOOP testLoop; CLOSE cur; END; phpmyadmin returns me MySQL said: Documentation #1064 -

MySQL error - “You have an error in your SQL syntax”

Deadly 提交于 2019-11-28 13:55:58
The error message I got: 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 ''word','group','selfnote') VALUES ('item','a','note to self')' at line 1 The PHP code is: $toq="INSERT INTO articles ('word','group','selfnote') VALUES ('$ttle','$wrdr','$snote')"; I was trying to find solutins, but they didn't seem to work as echoing gives: INSERT INTO articles ('word','group','selfnote') VALUES ('item','a','note to self') which seems nice to me. What is the problem? Use backticks ` instead of quotes ' to escape names.