Mariadb syntax error in multipleStatements - mariadb

When i am trying to execute the multipleStatements in Mariadb like this
db.Connection.query("CALL tep_procedure_out(?,#out_value);Select #out_value",["rahul"],
I set {multipleStatements: true} in my connection even though i am getting Error.
{ Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Select #out_value' at line 1 code: 1064 }

By default sending multiple statements is disabled (not only in node.js but in most other connectors) for security reasons.
If you want to use multiple statements you have to specify it when establishing the connection:
var conn = mysql.createConnection({multipleStatements: true});

Related

How do I set failed login attempts in MariaDB?

I'm attempting to configure failed login attempts with MariaDB 10.3. Using the following query (from mysql docs, hoping mariadb would be very similar):
ALTER USER 'mariadb_user'#'localhost' FAILED_LOGIN_ATTEMPTS 4 PASSWORD_LOCK_TIME UNBOUNDED;
This returns:
You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use
near 'FAILED_LOGIN_ATTEMPTS 4 PASSWORD_LOCK_TIME UNBOUNDED' at line 2
Does MariaDB actually support FAILED_LOGIN_ATTEMPTS? I didn't find anything useful when searching the documentation for relevant keywords.
This feature isn't supported by MariaDB.
As an alternative, you can use the global system variable max_password_errors which was introduced in MariaDB 10.4.
Note: max_password_errors will be ignored for localhost connections (:1, 127.0.0.1)

How to read an escaped table in SQL Server from R DBI?

I was able to use DBI::dbWriteTable to write a table with a non-standard name [name#place:funny/pages], but I am unable to read it back in with DBI::dbReadTable.
When I try with:
dbReadTable(con, '[name#place:funny/pages]')
I see the error:
Error: nanodbc/nanodbc.cpp:1655: 00000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Serv [Microsoft][ODBC Driver 17 for SQL Server][S L Serv 'SELECT * FROM "[name#place:funny/pages]"'
sessionInfo tells me I am using odbc_1.3.2 and DBI_1.1.1.
What am I doing wrong? Is there a way around the problem? I need to use that naming scheme to maintain compatibility with established processes.
I am able to read this table without issue from SQL with:
select * from [name#place:funny/pages]
The answer is to not include brackets at all.

MySQL Workbench cannot forward engineer, error 1064 [duplicate]

Im using xampp control panel and from there i start the process for apache and mysql. Then i go to mysql workbench and server status seems to be ok, here is some info
Host: Windows-PC
Socket: C:/xampp/mysql/mysql.sock
Port: 3306
Version 10.1.31-MariaDB mariadb.org binary distribution
Compiled For: Win32(32)
Configuratin File: unknown
Then everytime when i try to add the foreign key for my dummy schema like:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE;
;
ALTER TABLE `puppies`.`animals`
ADD CONSTRAINT `Breed`
FOREIGN KEY (`BreedID`)
REFERENCES `puppies`.`breeds` (`Breed`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
I get the following error
ERROR 1064: You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near
'' at line 2
SQL Statement:
ALTER TABLE `puppies`.`animals`
ADD INDEX `Breed_idx` (`BreedID` ASC) VISIBLE
So what can i do so that xampp will start using mysql syntax over mariaDb?
Or if im wrong in my understanding of the problem, then what should i do so that i dont have to face this kind of issues again when using xampp?
Problem is the word VISIBLE, remove it and it will work.
Index are visible by default.
Your question: "If i remove VISIBLE it works just fine, so why did mysql workbench decided to add visible?"
My answer: The option to mark index invisible is not yet implemented in MariaDB (afaik!).
Update:
The syntax for MariaDB is different, please see this reference: https://jira.mariadb.org/browse/MDEV-7317
Just to add to those who are using Maria DB with MySQL Workbench, you don't need to install mysql. You can just change 'Default Target MySQL Version' from Preferences to 5.7 or 5.6, and the VISIBLE keyword will be removed by workbench.
Here is a link from mysql bugs
https://bugs.mysql.com/bug.php?id=92269
I am using MySQL Workbench and have same problem. Change in the Preferences but it did not work.
Solution: If you export forward-engineer the model you need to change the configuration on another place.
Go to Model > Model Options
Inside the Model Options, go to MySQL
Then change the "Target MySQL Version" to 5.6

RobotFramework-Oracle DB Connection issue-2

I am trying to connect to Oracle DB in Robot Frameowork, I am facing an issue.find the details.
Error info:
15:26:34.601 INFO Connecting using : cx_Oracle.connect(database=KIDS, user=St1_User, password=M...., host=st-kids..oss.abb.com, port=1581)
15:26:34.692 FAIL TypeError: 'database' is an invalid keyword argument for this function
If I remove the "Database" from Keyword then getting below error
"NoSectionError: No section: 'default'"
Below is the command used in the Test Case
Connect To Database cx_Oracle kIDS St1_User M.... st-kids.oss.abb.com 1581
Please help.
Use keyword Connect To Database Using Custom Params
Connect To Database Using Custom Params cx_Oracle ${connection string}
and as ${connection_string}:
user='${user}',password='${password}',dsn='${host}:${port}/${service_name}'

MYSQL Import Failing because of `//`

I have a mysql file that seems to be breaking at some HTML/JS that is stored in the database.
Here are a few errors:
[ERROR in query 178] 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 '
and
[ERROR in query 179] 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 '}
// ]]>
</script>
<script src="./js/tooltip.js" type=' at line 1 [ERROR in query 180]
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 '}
/* ]]> */
and
[ERROR in query 181] 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 'Table
'./web_cms_prod/wp_redirection_logs'
is marked as crashed and should be re'
at line 1
Its a wordpress database if that matters, not sure why someone is storing HTML in the database, but I need to get it imported nonetheless.
Any ideas? Can I escape it somehow? A SED unix command would be nice as its a 9 meg file.
It's probably not the // but some quotes that appear before it. You need to make sure that all of the quotes contained within your string values are escaped.

Resources