How to set mysql system variable (session variable ) in ejabberd - ejabberd

I tried to set MYSQL system variable in ejabberd for decrypt message(AES decryption) but its not working.
I tried below code:
ejabberd_sql:sql_query(FServer,
[<<"SET SESSION block_encryption_mode = 'aes-256-cbc';">>]),

Related

How can i change the 'system_time_zone' variable in mysql server to "UTC+8" in my host machine(windows10 system)

the version of mysql server is 8.0.11 and the host machine's operate system is windows10 .I have read the mysql references in https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html. And it said that I can set the TZ environment variable to change the system_time_zone variable in mysql server.But after I set the TZ environment variable to "UTC+8" and restart the mysql server.The 'system_time_zone' is 'UTC',which I want it to be 'UTC+8'.How can I make it right?Thank you very much!

How to establish a database connection on Dbeaver

I am running mysql db as a docker image and everything was built correctly.
My Mysql image is running and I can see the container id but when I try to establish a connection on my workbench I get this error - "Public Key Retrieval is not allowed"
FYI - I passed the password to the db as an env variable in a separate file within the same dir
Please help
Go to Driver properties tab and set allowPublicKeyRetrieval to true. More details at MySQL Connection error with default Driver Properties
.

How to change value of mysql global variable default_authentication_plugin in Amazon Aurora Serverless MySQL 5.7.12

I'm using Amazon Aurora Serverless MySQL cluster(MySQL 5.7) and want to change the value of global variable default_authentication_plugin which is currently set to default ie. mysql_native_password
These are the commands I'm using to update the default authentication plugin
SET GLOBAL default_authentication_plugin = 'sha256_password';
SET ##GLOBAL.default_authentication_plugin = 'sha256_password';
But I'm getting below error
From the documentation, I can see the default_authentication_plugin is not a dynamic variable.
Also, I have checked in the DB Cluster Parameter Group the default_authentication_plugin parameter is not available there as well.
How do I change the value of the default_authentication_plugin in this case? Can someone help me?
Raised this issue with the AWS Support below is the reply I got.
There is no way to update value of default_authentication_plugin global variable as of now. But Amazon Aurora and RDS instances does supports sha256_password auth plugin.
Below command can be used to create users with sha256 hashed password.
CREATE USER '<username>'#'%' IDENTIFIED WITH sha256_password BY '<password>';

Configure max_allowed_packet on mySQL SERVER on AWS-EC2

I have an EC2 instance created with a MySQL server instance installed.
Since i am sending large blob data to be stored in the server, and the max_allowed_packet configuration is set to value 1048576, my service requests are failing.
I am trying to increase the size of the parameter to 16MB by using the below command via putty.
SET GLOBAL max_allowed_packet=16777216;
But there is no effect in the parameter. I tried restarting the sql server instance, still the effect isnt seen.
When i run the below command again after setting the parameter, the same old value is shown 1048576.
SHOW VARIABLES LIKE 'max_allowed_packet';
What am i missing here?
Update the MySQL server's configuration file /etc/my.cnf under [mysqld] section with the new value for max_allowed_packet
[mysqld]
max_allowed_packet=16M
and restart the server.
Values set via SET statement are not persisted across server restarts and are applied only on the new client sessions created after the change.
Excerpt from the documentation,
If you change a global system variable, the value is remembered and
used to initialize the session value for new sessions until you change
the variable to a different value or the server exits. The change is
visible to any client that accesses the global value. However, the
change affects the corresponding session value only for clients that
connect after the change. The global variable change does not affect
the session value for any current client sessions (not even the
session within which the global value change occurs).

Change mysql system variable without restart

Is there any way to change value of "skip_name_resolve" variable on windows mysql server without restarting service?
This variable is not dynamic, and cannot be changed with SET query:
mysql> set global skip_name_resolve="ON";
ERROR 1238 (HY000): Variable 'skip_name_resolve' is a read only variable
The MySQL server maintains many system variables that indicate how it
is configured. Section 5.1.4, “Server System Variables”, describes the
meaning of these variables. Each system variable has a default value.
System variables can be set at server startup using options on the
command line or in an option file. Most of them can be changed
dynamically while the server is running by means of the SET statement,
which enables you to modify operation of the server without having to
stop and restart it. You can refer to system variable values in
expressions.
this is taken from http://dev.mysql.com/doc/refman/5.0/en/using-system-variables.html
ideally you should be able to change a variable by just using SET query.