Connection Arguments in MySQL connection in Data Fusion - mysql

I am trying to set up Data Fusion MySQL connection ( JDBC plugin v. 8.0.25) with connection arguments that are not default. Somehow it won't let me use them and keep just ignoring them.
P.S. Local connection is just set to see the error and arguments that it is passing. Otherwise connection is just successful ( with default arguments )
I have tried changing values of connectTimeout and socketTimeout to 0, 99999999 etc but it just keep setting it to 20000 ms.
I except these values to overwrite since I am trying to pass my own arguments there.

Related

How to get max_allocated_packets from JDBC connection from a Slick DB connection to MySQL

Is there a way via Scala with Slick database query and access library (or using other tricks - dare I say mocks?) to get max_allocated_packets from JDBC-read connection properties from a Slick-style DB connection to MySQL?
As I suspect, the code makes several touch type actions at deeper levels and this connection property is then populated.
Ex: Once a connection is made in com.mysql.cj.jdbc.ConnectionImpl ... using Scala with the Slick library... the value for the JDBC connect property of max_allocated_packets is within the object (debugged in IntelliJ). How can I extract this value or obtain it in higher level code as asked above?
Of course I can query the DB directly to get that value, but I am hoping I can extract this property after the setup phase.
If the value is publically available on a connection, you could try to use SimpleDBIO action to access the JDBC-level values.
See: https://scala-slick.org/doc/3.2.0/dbio.html#jdbc-interoperability
It would be of the form:
val getMaxPacketAction = SimpleDBIO[Int] { database =>
// make use of database.connection here
}
However, this is still going to the database for a connection, so it may be just easier to query for the value you want.

how to programmatically reject new connections on 4d v17?

are there commands similar to WEB STOP SERVER and STOP SQL SERVER but to reject new connections on my 4d server?
i found out that by using the On Server Open Connection Database Method , i can reject new connections by returning a value different than 0 as seen in the doc
If you do not return a value in $0, thereby leaving the variable undefined or initialized to zero, 4D Server assumes that the database method accepts the connection. If you do not accept the connection, you return a non-null value in $0.
so i just change the return value $0 under the conditions i need
If(*some conditions*)
$0:1
End If

How to fix mysql uppercase query in php and mysql

I am currently working on the website that uses ADODB library. In entire website all the queries are written in UPPERCASE.
The problem is when I run the query it doesn't work because of table name which is UPPERCASE. But when I change the table name to lowercase it works.
$sql = "SELECT * FROM MEMBERS where USERNAME = '$username'";
$db = ADONewConnection('mysql');
$db->debug = true;
$db->Connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME);
$resultFriends = $db->Execute($sql);
while ($row = $resultFriends->FetchRow()) {
var_dump($row);
die;
}
Here is the error I get:
ADOConnection._Execute(SELECT * FROM MEMBERS where USERNAME = 'fury', false) % line 1012, file: adodb.inc.php
ADOConnection.Execute(SELECT * FROM MEMBERS where USERNAME = 'fury') % line 15, file: index.php
Bear in mind I don't want to change the scripts. There are 1000 files and 10000 places.
Is there any library or are there any way that I can run this queries without error?
The version for live sire was linux kernel. but the new dev site is ubuntu.
I have done this on ubuntu/ mysql CML and it didn't work.
The solution is I had to reconfigure the mySql database in AWS/rdbs
You have to modify the “lower_case_table_names” parameter for your DB Instance(s). Prior to today, the lower_case_table_names parameter was not modifiable, with a system default of zero (0) or “table names stored as specified and comparisons are case sensitive.” Beginning immediately, values of zero and one (table names are stored in lowercase and comparisons are not case sensitive) are allowed. See the MySQL documentation for more information on the lower_case_table_names parameter.
The lower_case_table_names parameter can be specified via the rds-modify-db-parameter-group API. Simply include the parameter name and specify the desired value, such as in the following example:
rds-modify-db-parameter-group example --parameters "name=lower_case_table_names, value=1, method=pending-reboot" --region us-east-1
Support for modifying parameters via the AWS Management Console is expected to be added later this year.
setting the lower_case_table_names parameter via a custom DB Parameter Group and doing so before creating an associated DB Instance. Changing the parameter for existing DB Instances could cause inconsistencies with point-in-time recovery backups and with Read Replicas.
Amazon RDS

Trying to set useLegacyDatetimeCode to false in MySQL fails

When I set useLegacyDatetimeCode=false in my JDBC connection properties, I get this error message:
java.sql.SQLException: The server timezone value 'CET' represents more
than one timezone. You must configure either the server or JDBC driver
(via the serverTimezone configuration property) to use a more specifc
timezone value if you want to utilize timezone support. The timezones
that 'CET' maps to are: Europe/Tirane, Europe/Andorra, Europe/Vienna,
Europe/Minsk, Europe/Brussels, Europe/Sofia, Europe/Prague,
Europe/Copenhagen, Europe/Tallinn, Europe/Berlin, Europe/Gibraltar,
Europe/Athens, Europe/Budapest, Europe/Rome, Europe/Riga,
Europe/Vaduz, Europe/Vilnius, Europe/Luxembourg, Europe/Malta,
Europe/Chisinau, Europe/Tiraspol, Europe/Monaco, Europe/Amsterdam,
Europe/Oslo, Europe/Warsaw, Europe/Lisbon, Europe/Kaliningrad,
Europe/Madrid, Europe/Stockholm, Europe/Zurich, Europe/Kiev,
Europe/Uzhgorod, Europe/Zaporozhye, Europe/Simferopol,
Europe/Belgrade, Africa/Algiers, Africa/Tripoli, Africa/Casablanca,
Africa/Tunis, Africa/Ceuta.
I understand what the message is telling me, but I'm not sure what to do about it. I don't have any way of knowing what time zone the MySQL server is running in (this is software that my customers install, and the servers are not managed by me).
I need to set this property to false to fix MySQL time zone bugs.
You need to pass an additional parameter like this:
db=jdbc:mysql://localhost/db?user=me&pass=secret&useLegacyDatetimeCode=false&serverTimezone=Europe/Vienna

changing rewriteBatchedStatements with play, hibernate and mysql

I'm trying to optimize for bulk inserts via play(1.2.4)+mysql.
I saw some posts talking about adding the following to jdbc configuration (adding it to the connection string): useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true
I've tried to do:
db=mysql://root#localhost/data?useServerPrepStmts=false&rewriteBatchedStatements=true&useCompression=true
But I get this error:
A database error occured : Cannot connected to the database, The connection property 'useCompression' only accepts values of the form: 'true', 'false', 'yes' or 'no'. The value 'true?useUnicode=yes' is not in this set.
I also tried to use db=jdbc:mysql://....
Still no luck.
What am I missing?
Play automatically appends the MySQL connection string with the following:
?useUnicode=yes&characterEncoding=UTF-8&connectionCollation=utf8_general_ci
So I am guessing your connection string ends up invalid as there is now two sets of parameters (starting with a question mark).
Unfortunately, that part of Play code is quite hard-coded in the DBPlugin class which means that you can't add the options that way. You will have to look for a way to alter the options in a later stage.