In MySQL you can make logging appear in JSON format by installing component_log_sink_json component and enabling this component:
INSTALL COMPONENT 'file://component_log_sink_json';
SET PERSIST log_error_services = 'log_filter_internal; log_sink_json';
Source: https://dev.mysql.com/doc/refman/8.0/en/error-log-json.html
But this does not work in MariaDB:
MariaDB > INSTALL COMPONENT 'file://component_log_sink_json';
ERROR 1064 (42000): 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 'COMPONENT 'file://component_log_sink_json'' at line 1
MariaDB > SET log_error_services = 'log_filter_internal; log_sink_json';
ERROR 1193 (HY000): Unknown system variable 'log_error_services'
How can I make MariaDB log in JSON format?
Related
I have installed the Ubuntu postgreSQL very quickly, using the following command,
$sudo apt install postgresql postgresql-contrib
And I login into the database using he following command,
$sudo -i -u postgres
$psql
Then I create the table and index of my database in it. I can see that the database is correctly imported, and have index created, and the database is ready to go.
But the problem is in the R program, I use the library(RPostgreSQL) to connect to the database, I have filled the connection details as follows,
connection <- dbConnect(driver, dbname='testchr22', host='localhost', port=5432, user= 'postgres', password='')
But all the connection failed.
But my problem is the database connection always have problems, I didn’t set up the password, I don’t know what password should include.
I have always encounter the following errors, forever, and don't know where I got it wrong.
Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: ()
Calls: batchAnnotate -> dbConnect -> dbConnect -> postgresqlNewConnection
Execution halted
I did the following to set password restrictions for my users on MariaDB.
ALTER USER 'User Name' FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 3;
But I get the following error and cannot do it.
Why is this?
ERROR 1064 (42000): 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 3 PASSWORD_LOCK_TIME 3' at line 1
As mentioned in the comments, MariaDB does not have this feature.
I am using pyodbc to connect to an azure synapse db from a centos box.
I get
"Unable to set SQL_ATTR_CONNECTION_POOLING attribute"
right from the pyodbc.connect() method.
I did try to set pyodbc.pooling = False, before trying to get the connection, but then I get
"'utf-8' codec can't decode byte 0xf5 in position 2: invalid start byte"
which is weird since I am not executing any query, just pyodbc.connect(...)
I also tried to set odbc trace but I get nothing in the log...
Here's my env:
OS: CentOS Linux release 7.5.1804 (Core)
Python: Python 3.7.4
Pyodbc: Version: 4.0.30
ODBC: unixODBC 2.3.7
odbcinst.ini:
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.6.so.1.1
UsageCount=1
Is there a way to troubleshoot ?
Forgot to mention that I get the same message if I use the wrong driver name, or any of the other connection params.
thank you in advance
We are glad to hear that the error is solved.
For details, please see the GitHub here:
https://github.com/mkleehammer/pyodbc/issues/847#issuecomment-733087938
I install a laragon on my windows 10 and using the latest mariadb database
Ver 15.1 Distrib 10.2.12-MariaDB, for Win64 (AMD64)
but when I try to connect using this command
mysql -u root -p
I received this error
ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)
What is this error?
I don't know what to do.
When you install MariaDB, by default it creates a database called "mysql".
If you delete that database, that exact error will appears. The solution is either recover that database or reinstall mariadb. I spent one day figuring out why does that error appeared to me.
Conclusion: Don't delete "mysql" database from mariadb.
While installing oracle 11g XE on docker i am getting the error.
Following are the output:-
/etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration
This will configure on-boot properties of Oracle Database 11g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:8080
Specify a port that will be used for the database listener [1521]:1521
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...Done
Configuring database...
Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details
[root#b7c63c4e1da8 Disk1]# cd /u01/app/oracle/product/11.2.0/xe/config/log
[root#b7c63c4e1da8 log]# ls
CloneRmanRestore.log cloneDBCreation.log postDBCreation.log postScripts.log
[root#b7c63c4e1da8 log]# cat CloneRmanRestore.log
ORA-00845: MEMORY_TARGET not supported on this system
select TO_CHAR(systimestamp,'YYYYMMDD HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
declare
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
select TO_CHAR(systimestamp,'YYYYMMDD HH:MI:SS') from dual
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
One of the possible solution that I got was to mount the temp file to provide extra space to it which only contains 6GB approx in the docker. But i am unable to mount the memory in docker.
Got the solution for the same :-
we have to modify the files init.ora and initXETemp.ora at the path /u01/app/oracle/product/11.2.0/xe/config/scripts
with the values :-
###########################################
# Miscellaneous
###########################################
compatible=11.2.0.0.0
diagnostic_dest=/u01/app/oracle
#memory_target=1073741824
pga_aggregate_target=200540160
sga_target=601620480
You may encounter
ORA-00845: MEMORY_TARGET not supported on this system
when starting Oracle DB in an unprivileged container. Try running the container with the --privileged flag, e.g.
docker run --name oracle12 --hostname oracledb --privileged local/oracle12:12.1.0.2