Является ли MariaDB 10.3 совместимым с MySQL 8.0.20, проверка зависимостей не удалась

Я установил Ubuntu 20.04 применяется Devstack для приложения Openstack

работает mysql:

stack@rafael-VirtualBox:~/devstack$ **mysql --version**
mysql  Ver 8.0.20-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

stack@rafael-VirtualBox:~/devstack$ **mysql**

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 68
Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

root@rafael-VirtualBox:~# **systemctl status mysql**

mysql.service - MySQL Community Server

     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)

     Active: active (running) since Tue 2020-06-02 15:09:08 CDT; 2 days ago
    Process: 986 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
   Main PID: 1086 (mysqld)
     Status: "Server is operational"
      Tasks: 61 (limit: 4616)
     Memory: 325.4M
     CGroup: /system.slice/mysql.service
             └─1086 /usr/sbin/mysqld


Jun 02 15:08:41 rafael-VirtualBox systemd[1]: Starting MySQL Community Server...
Jun 02 15:09:08 rafael-VirtualBox systemd[1]: Started MySQL Community Server.


Когда я пытаюсь установить MariaDB:

обновление sudo apt sudo apt установить mariadb-сервер sudo mysql_secure_installation

Я получаю следующее:

root @ rafael-VirtualBox : ~ # sudo apt-get update

Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
root@rafael-VirtualBox:~# sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease         
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
45 packages can be upgraded. Run 'apt list --upgradable' to see them.

root@rafael-VirtualBox:~# sudo apt install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 **mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.22-1ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.**

Итак, эта ошибка привела меня к циклу .... почему он не будет установлен автоматически? ??

Следующие пакеты имеют неудовлетворенные зависимости: mariadb-server: Зависит от: mariadb-server-10.3 (> = 1: 10.3.22-1ubuntu1), но он не будет установлен

E: Невозможно исправить проблемы, у вас есть поврежденные пакеты.

Кажется как смена команд, добились цели:

sudo apt install mariadb-server-10.3
sudo apt install mariadb-server
root@rafael-VirtualBox:/var/log# sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Enter current password for root (enter for none):

Итак, как мне разрешить ОШИБКУ 2002, ни у одной из веб-информации или видео на YouTube нет Ubuntu 20.4 с MariaDb 10.3

спасибо Рафаэль


ОБНОВЛЕНИЕ:

Я отредактировал /etc/mysql/my.cnf и / etc / mysql / cnf, чтобы пройти эту проблему, но наткнулся на другую ....

#cat > /etc/mysql/my.cnf << EOF
#cat > /etc/mysql/mariadb.cnf << EOF

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

[mysqld]
max_connections = 1024
#default-storage-engine = InnoDB
#sql_mode = TRADITIONAL
#bind-address = 0.0.0.0
#lower_case_table_names = 2
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr/bin
datadir     = /var/lib/mysql
tmpdir      = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

innodb_buffer_pool_size = 10M
innodb_log_file_size = 1000M

character_set_server           = utf8mb4                             # For modern applications, default in MySQL 8.0
thread_cache_size              = 151                                 # Up to max_connections makes sense


[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

следующая проблема:

Jun  4 20:55:21 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:21 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
Jun  4 20:55:21 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:21 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
Jun  4 20:55:22 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:22 0 [Note] InnoDB: Starting shutdown...
Jun  4 20:55:22 rafael-VirtualBox kernel: [ 6034.871865] audit: type=1400 audit(1591322122.402:15641): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnect
ed path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=76969 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=132 ouid=0
Jun  4 20:55:22 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:22 0 [ERROR] Plugin 'InnoDB' init function returned error.
Jun  4 20:55:22 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:22 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Jun  4 20:55:22 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:22 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun  4 20:55:22 rafael-VirtualBox mysqld[76969]: 2020-06-04 20:55:22 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded

затем пришлось очистить системные таблицы:

systemctl stop mariadb
rm -R /var/lib/mysql/*
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

перезапустил службу Mariadb, ошибок нет, но застрял в состоянии активации:

root@rafael-VirtualBox:/opt/stack# systemctl start mariadb

root@rafael-VirtualBox:/var/lib/mysql# systemctl status mariadb
● mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: activating (start) since Thu 2020-06-04 21:20:03 CDT; 9s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 78228 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 78235 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 78237 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_STAR>
   Main PID: 78300 (mysqld)
      Tasks: 30 (limit: 4616)
     Memory: 55.2M
     CGroup: /system.slice/mariadb.service
             └─78300 /usr/sbin/mysqld

Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] InnoDB: Waiting for purge to start
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] InnoDB: 10.3.22 started; log sequence number 1625457; transaction id 21
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] InnoDB: Buffer pool(s) load completed at 200604 21:20:03
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] Server socket created on IP: '::'.
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] Reading of all Master_info entries succeeded
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] Added new Master_info '' to hash table
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: 2020-06-04 21:20:03 0 [Note] /usr/sbin/mysqld: ready for connections.
Jun 04 21:20:03 rafael-VirtualBox mysqld[78300]: Version: '10.3.22-MariaDB-1ubuntu1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Ubuntu 20.04
lines 1-24/24 (END)

:

Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.


root@rafael-VirtualBox:/opt/stack# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Thu 2020-06-04 21:14:44 CDT; 1min 24s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 77248 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 77256 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 77261 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemc>
    Process: 77318 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
   Main PID: 77318 (code=exited, status=0/SUCCESS)

Jun 04 21:14:43 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:43 0 [Note] Event Scheduler: Purging the queue. 0 events
Jun 04 21:14:43 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:43 0 [Note] InnoDB: Starting shutdown...
Jun 04 21:14:43 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:43 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
Jun 04 21:14:43 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:43 0 [Note] InnoDB: Instance 0, restricted to 160 pages due to innodb_buf_pool_du>
Jun 04 21:14:43 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:43 0 [Note] InnoDB: Buffer pool(s) dump completed at 200604 21:14:43
Jun 04 21:14:44 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:44 0 [Note] InnoDB: Shutdown completed; log sequence number 1625457; transaction >
Jun 04 21:14:44 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:44 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
Jun 04 21:14:44 rafael-VirtualBox mysqld[77318]: 2020-06-04 21:14:44 0 [Note] /usr/sbin/mysqld: Shutdown complete
Jun 04 21:14:44 rafael-VirtualBox systemd[1]: mariadb.service: Failed with result 'timeout'.
Jun 04 21:14:44 rafael-VirtualBox systemd[1]: Failed to start MariaDB 10.3.22 database server.

Я приму предложение продолжить расследование


ОБНОВЛЕНИЕ


Похоже есть ошибка при установке Mariadb


echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
systemctl restart mariadb
Background
If you previously had MySQL installed, it activated an AppArmor profile which is incompatible with MariaDB. apt-get remove --purge only removes the profile, but does not deactivate/unload it. Only manually unloading it lets MariaDB work unhindered by AppArmor.

https://stackoverflow.com/questions/40997257/mysql-service-fails-to-start-hangs-up-timeout-ubuntu-mariadb

Мой вывод изменился на ACTIVE :

root@rafael-VirtualBox:/var/lib/mysql# echo "/usr/sbin/mysqld { }" > /etc/apparmor.d/usr.sbin.mysqld
root@rafael-VirtualBox:/var/lib/mysql# apparmor_parser -v -R /etc/apparmor.d/usr.sbin.mysqld
Removal succeeded for "/usr/sbin/mysqld".
root@rafael-VirtualBox:/var/lib/mysql# systemctl restart mariadb
root@rafael-VirtualBox:/var/lib/mysql# systemctl status mariadb
● mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2020-06-04 21:27:03 CDT; 5s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 78643 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 78655 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 78657 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_STAR>
    Process: 78745 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 78747 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 78713 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 31 (limit: 4616)
     Memory: 60.2M
     CGroup: /system.slice/mariadb.service
             └─78713 /usr/sbin/mysqld

Jun 04 21:27:03 rafael-VirtualBox mysqld[78713]: 2020-06-04 21:27:03 8 [Warning] Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
Jun 04 21:27:03 rafael-VirtualBox mysqld[78713]: 2020-06-04 21:27:03 9 [Warning] Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78752]: Looking for 'mysql' as: /usr/bin/mysql
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78752]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78752]: Version check failed. Got the following error when calling the 'mysql' command line client
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78752]: ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78752]: FATAL ERROR: Upgrade failed
Jun 04 21:27:03 rafael-VirtualBox /etc/mysql/debian-start[78762]: Checking for insecure root accounts.
Jun 04 21:27:03 rafael-VirtualBox mysqld[78713]: 2020-06-04 21:27:03 10 [Warning] Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
Jun 04 21:27:03 rafael-VirtualBox debian-start[78765]: ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
1
задан 5 June 2020 в 05:30

1 ответ

Ok, I think I got it to work.

After following the above steps, the bug with AppArmor provides commands with nice set of directions to install db:

root@rafael-VirtualBox:/opt/stack# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h rafael-VirtualBox password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Now I am able to access the Mariadb on Ubuntu 20.04

stack@rafael-VirtualBox:/usr$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 21
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

version:

stack@rafael-VirtualBox:/usr$ mysql --version
mysql  Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
0
ответ дан 19 June 2020 в 21:30

Другие вопросы по тегам:

Похожие вопросы: