Instalando o MariaDB ao lado do MySQL

1

Eu quero instalar o MariaDB ao lado do MySQL. No Windows, é muito fácil, porque só precisa mudar a porta. Enquanto no Ubuntu é uma história diferente.

Eu fiz as etapas a seguir para a instalação, mas sempre recebo essa mensagem de erro por journalctl -xe , embora my.cnf já exista e tenha permissões de prober!

mysqld[26621]: Could not open required defaults file: /opt/mariadb-data/my.cnf
mysqld[26621]: Fatal error in defaults handling. Program aborted
systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mariadb.service: Unit entered failed state.
systemd[1]: mariadb.service: Failed with result 'exit-code'.
systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped MariaDB Database.

Etapas da instalação:

cd /opt
tar -zxvpf mariadb-10.2.14-linux-x86_64.tar.gz
ln -s mariadb-10.2.14-linux-x86_64 mariadb
mkdir mariadb-data
mkdir /opt/mariadb-data/tmp
groupadd --system mariadb
useradd -c "MariaDB Server" -d /opt/mariadb -g mariadb --system mariadb
cp my.cnf mariadb-data/my.cnf #see the content below
chown -R mariadb:mariadb mariadb-10.2.14-linux-x86_64/
chown -R mariadb:mariadb mariadb-data/
chmod -R 700 mariadb-data/
cd mariadb
scripts/mysql_install_db --user=mariadb --defaults-file=/opt/mariadb-data/my.cnf
cd ..
cp mariadb.service /etc/systemd/system/ #see the content below
systemctl daemon-reload
systemctl start mariadb.service

O resultado de systemctl status mariadb.service é:

● mariadb.service - MariaDB Database
   Loaded: loaded (/etc/systemd/system/mariadb.service; static; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: inactive (dead)

systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped MariaDB Database.
systemd[1]: Started MariaDB Database.
systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: mariadb.service: Unit entered failed state.
systemd[1]: mariadb.service: Failed with result 'exit-code'.
systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped MariaDB Database.
systemd[1]: mariadb.service: Start request repeated too quickly.
systemd[1]: Failed to start MariaDB Database.

O resultado de /opt/mariadb/bin/mysqld_safe --user=mariadb --ledir=/opt/mariadb/bin é:

# /opt/mariadb/bin/mysqld_safe --user=mariadb --ledir=/opt/mariadb/bin
180507 14:20:33 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
180507 14:20:33 mysqld_safe Logging to '/var/log/mysql/error.log'.
180507 14:20:33 mysqld_safe A mysqld process already exists
  • /opt/mariadb-data/my.cnf

link

  • /etc/systemd/system/mariadb.service

link

  • Permissões de /opt

Access: (0755/drwxr-xr-x) Uid: (0/root) Gid: (0/root)

  • Permissões de /opt/mariadb-data

Access: (0700/drwx------) Uid: (999/mariadb) Gid: (999/mariadb)

  • Permissões de /opt/mariadb-data/my.cnf

Access: (0700/-rwx------) Uid: (999/ mariadb) Gid: (999/ mariadb)

    
por mbnoimi 07.05.2018 / 13:20

0 respostas