mysql shows error : Error in query (1582): Incorrect parameter count in the call to native function 'AES_DECRYPT'
I'm using mariaDB
I have tried differnet options but all ends up at same place
SET #key_str = '3C5QYgFQr9AARjMyLNNQ3fL8QauXLTz0';
SET #iv = 'kaNUE3JAIVB9Em9v';
SET #ciphertext = AES_ENCRYPT('Hello', #key_str, #iv);
SELECT AES_DECRYPT(#ciphertext, #key_str, #iv);```
My requirement is to use aes-256-cbc encryption using MariaDB
If you are using MariaDB, you should read the MariaDB documentation, not the MySQL documentation.
https://mariadb.com/kb/en/aes_encrypt/ shows AES_ENCRYPT() only has two arguments. This matches the implementation of that function as of MySQL 5.5, when MariaDB forked from MySQL in 2010. Since then, MySQL 5.7 and later changed the function to accept more arguments.
In general, you shouldn't think of MariaDB and MySQL as variants of the same product anymore. They have both changed significantly since they forked, and there are many cases where they are no longer compatible.
Here's a feature request for MariaDB to support the IV and block encryption mode: https://jira.mariadb.org/browse/MDEV-9069
As of 2022-12-12 (version 10.10 is current as I write this), the feature is not yet implemented. So there is no support currently in MariaDB for CBC or other encryption modes. It still functions as it did in MySQL 5.5.
Related
I am running local MySQL instance version of 5.7.23 in Ubuntu-18-04. The DB is already having some tables having JSON fields to store JSON data. They working fine with insert, update and delete operations.
The issue comes when try to modify an existing table to have a new field to store JSON data. MySQL-Workbench is giving an error saying
Type not supported
The JSON data is not available before MySQL 5.7.8.
In order to use it, first set the version for your model to 5.7.8 or
higher
Following screen shots shows my local environment information.
The error:
MySQL server info:
MySQL Workbench info:
I was able to figure the issue. The default version set for Modeling MySQL was set as 5.6.30. Changed it to 5.7.8 and works the table schema modification.
Go to Edit -> Preferences... in MySQL Workbench
Refer the below screens:
Before:
After:
Preference doesn't work for me. I use osx with workbench version 8.0.11.
Model in top bar menu -> Model Options -> MySQL then change the version as Shantha's answer works for me.
Previous version of MySQLWorkbench (6.3.10) has better error message for this...
I work with Eclipse and I want to use the version 7 of Liferay but when I run my Tomcat server I have an error with MySQL.
Please upgrade to at least MySQL 5.6.4. The portal no longer supports older versions of MySQL
Like this the problem is pretty obvious but my SQL version is already 5.7.19
I have check my driver of MySQL in preference->data management->connectivity->driver definition and my MySQL JDBC Driver is 5.1
I want to know if someone already had this issue and know how to fix it
This is how the version gets validated, and this is how the version string gets constructed. I'd say: Please make extra extra extra sure that you are addressing the mysql server that you intend to address:
You can check your mysql version from the mysql command line client by executing select version();. Get your credentials and database URL from Liferay's portal-ext.properties or your appserver's connection pool configuration, depending on where you configured it.
Mysql documentation says
When using versions of the JDBC driver earlier than 3.2.1, and connected to server versions earlier than 5.0.3, the setFetchSize() method has no effect, other than to toggle result set streaming
What about after 5.0.3? Can I use setFetchSize(100) now? Will it work?
It will indeed work if you also set the JDBC option useCursorFetch for the connection.
However, due to the way MySQL implements server-side cursors, you will have to wait for the query to complete on the server before results arrive, and you will consume additional memory server-side.
I'm trying to set the lower_case_table_name value to 2, since it is a Windows server. But when I start MySQL Workbench and connect to my server I get the following error:
A server is in a system that does not properly support the selected lower_case_table_names option value.
Shouldn't a Windows server support a value of 2? I'm running MySQL 5.6 on Windows Server 2012 and using MySQL Workbench 6.3.
You can safely ignore this error.
I recently installed MySQL on a new Windows computer and got this error as well after setting lower_case_table_names to 2. I don't remember seeing it previously. However, despite the error it seems to be working properly..tables are created with the proper case and I can do case-insensitive lookups.
Changing the value to lower_case_table_names = 1 prevents the warning. The windows default is 1. For the setting of this variable see:
https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html
I am using MYSQL and EF5(DB first) with connector/net 6.8.3.0. Everything works fine on my local machine but when I upload it to server it throws exception "Facet 'Precision' must not be specified for type 'datetime'".
Please let me know what is the reason.
Precision for datetime is added with MYSQL version 5.6 and I have generated the entities with latest MYSQL, so by default precision is added to the ssdl.
But on my server older version of MYSQL server was installed. This is the reason why it was throwing the exception.
Now with MYSQL server 5.6 we can have datetime(5) where 5 is the precision.
So we can have microsecond for datetime in MYSQL.
I too have been getting the "Facet 'Precision' must not be specified for type 'datetime'" error after publishing, but the cause of my problem differs from the OP's.
My Personal Solution
I have two independent servers: 'server1' with the EF5 web app, 'server2' with the database server1 references. Debugging the app on my local machine was no problem; but after I published to server1 the app kept crashing while trying to load. After much searching and testing I narrowed it down to either a configuration issue either with my application or MySQL. Finding this post (thank you kindly, user3275493, for answering your own question), I checked server2's MySQL config but alas it was already running MySQL Server 5.6. Just to be thorough (in reality this took me several days to realize), I decided to check MySQL Connecter and discovered that my local machine's was version 6.8.3 while server1's was version 5.6. After I updated Connector, I published my web app and it ran without flaw!
Simple Explanation
Not only will this error be caused by a MySQL version disagreement between Entity Framework and MySQL Server, but also between Entity Framework and MySQL Connector!