How to fix /usr/sbin/mysqld: unknown option '--daemonize' - service

After uograding, mariadb is not starting on Ubuntu 18.04
The log file says
/usr/sbin/mysqld: unknown option '--daemonize'
Starting /usr/sbin/mysqld on the command line works
I am on version 10.1.41
mysql --version
mysql Ver 15.1 Distrib 10.1.41-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Unlike MySQL, the --daemonize option in MariaDB is not supported.
So it looks like, that MySQL was replaced by MariaDB, but the configuration file was not updated properly.
Try to remove the daemonize option in /etc/systemd/system/mysql*.service configuration files.

Related

How can I use pg_dump in Kubernetes in order to generate dump from a remote PostgreSQL (PGAAS)?

I would like to generate dump from a remote PostgreSQL database (PGAAS) with commands or Python code.
Firstly I tried locally to do the work but I have an error :
pg_dump: error: server version: 13.9; pg_dump version: 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1)
I tried this code :
import subprocess
dump_file = "database_dump.sql"
with open(dump_file, "w") as f:
print(f)
subprocess.call(["pg_dump", "-Fp", "-d", "dbdev", "-U", "pgsqladmin", "-h", "hostname"-p", "32000"], stdout=f)
How can I do to have a pod (container) doing this work and where version is the same that server version, without entering pgaas password manually ?
pg_dump: error: server version: 13.9; pg_dump version: 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1)
As you can see this error is caused because of a version mismatch checking the version of your PGaaS database and the database version you are using on your local machine. If your local version is lower than that of the server version you can upgrade the local version. Follow this document for upgrading your pg version.
If you want to take dumps at regular intervals in an easy way you can have a cron job scheduled on your vm for running your code. Since you want to use kubernetes, build a docker image with your code in it and create a kubernetes job and run it with kube-scheduler and you can use environment variables for encrypting your password.

Installing OpenVAS on Kali / Debian problem with PostgreSQL version

After installing OpenVAS on Kali linux, ran gvm-setup command to setup GVM as per instructions: https://linuxhint.com/install-openvas-kali-linux/
However, the following error ocurred:
ERROR: The default postgresql version is not 13 required by libgvmd
Error: Use pg_upgradecluster to update your postgres cluster
So, I checked the version of PostgreSQL installed by:
$ su postgres
$ psql --version
psql (PostgreSQL) 13.2 (Debian 13.2-1)
The version was 13.
How can I complete the gvm-setup?
gvm-setup will look for PostgreSQL on port 5432. If you have more than one version of PostgreSQL installed, they will be assigned incremental port numbers starting at 5432. To check for other versions of PostgreSQL, you can look in the /etc/postgresql/ directory. You may see multiple directories, corresponding to the PostgreSQL versions you have installed.
You should go into each version and edit the postgresql.conf file to change the port number of PostgreSQL 13 to 5432, and assign other port numbers to the other versions. So if you had PostgreSQL 12 and 13 installed:
Edit the PostgreSQL 12 config file
$ nano /etc/postgresql/12/main/postgresql.conf
find the line port = 5432 and change to:
port = 5433
Edit the PostgreSQL 13 config file
$ nano /etc/postgresql/13/main/postgresql.conf
find the line port = 5433 and change to:
port = 5432
Finally restart PostgreSQL:
systemctl restart postgres
and then run gvm-setup again
gvm-setup
The error message tells you, that you should upgrade your postgres cluster. There could already be a higher version of postgres cluster created in your system, which you can examine with the following command:
sudo pg_lsclusters
However, this auto generated cluster might not always function as intended (e.g. it operates on different from default port). Thus, it's best to perform manual cluster upgrade (you can omit step 1 if you don't have any auto generated cluster). Assuming that you want to upgrade from version 13 to 14:
delete automatically generated cluster version 14 (use --stop if service status is not down):
sudo pg_dropcluster --stop 14 main
migrate cluster version 13 to version 14:
sudo pg_upgradecluster 13 main
optionally, you can drop the old cluster:
sudo pg_dropcluster --stop 13 main
That's it! The new cluster will listen on the port, that were previously used by the old cluster. It might be needed to start or enable postgres service in systemd in order to use PostgreSQL in other applications.

MySQL Workbranch crushes when save EER Diagram on Debian

When tiring to save EER or read from file the MySQL Workbench dies...
MySQL Workbench version 6.3.10
Failing on Debian GNU/Linux buster/sid
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted
The issue is that it cannot see "en_US.UTF-8" so you need to verifiy that
sudo vi /etc/locale.gen # should have 'en_US.UTF-8 UTF-8'
sudo locale-gen
any you can run
LC_ALL="en_US.UTF-8" mysql-workbench

Set up Postgresql-93 on Centos 7

I followed this Almost idiot's guide to install postgresql and postgis on Centos 7 and got stuck starting the database itself with the following command:
[root#localhost cmaps]# service postgresql-9.3 initdb
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
If I install the postgresql package from Centos repository (version 9.2) the command works, but then I they don't have postgis, and there is no official posgresql-92 repository for Centos 7.
Any idea on what's happening?
Thank you!
I had the same problem and solve it by changing the path
/usr/pgsql-9.3/bin/postgresql93-setup initdb
Note that the path is different
CentOS 7 is based on systemd. PostgreSQL packages use a different command for initdb there:
/usr/lib/pgsql-9.3/bin/postgresql93-setup initdb
On older versions, call the initscript directly.
/etc/init.d/postgresql-9.3 initdb
For Centos 7.3 installed on MS Azure platform the script is located at
/usr/bin/postgresql-setup initdb
the version number is absent from the name of these as well:
db data & config location: /var/lib/pgsql/data/
service name /sbin/service postgresql status or systemctl status postgresql.service

Where is Postgres 9.1 log located by default in Ubuntu

Where I can find startup log of of my postgres 9.1 server.
I'm using Ubuntu.
postgres restart gets failed.
find / -name pg_log founds nothing
standard log at /etc/postgres/main/9.1/ is clear
In RedHat like distributions it would be in /var/lib/pgsql/pgstartup.log or look for the variable PGLOG in the init script in /etc/init.d/postgresql
In Ubuntu it is one of the files in /var/lib/postgresql/9.3/main/pg_log/.