Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: Как установить MySQL server на Ubuntu 18.04 bionic на облачном Hetzner сервере  (Прочитано 718 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн cegthgtlhj

  • Автор темы
  • Новичок
  • *
  • Сообщений: 11
    • Просмотр профиля
Сам я абсолютный нуль в линуксах. Мне нужно установить MySQL server и развернуть на нем Джанго вебсайт.
У меня облачный сервер на Hetzner.de Ubuntu 18.04.4 LTS /// bionic
Начал устанавливать MySQL server, начал по простому

sudo apt update
sudo apt upgrade
sudo apt install mysql-server

Это не сработало.
Перерыл как минимум 10 веток на stackoverflow.com и перепробовал их.
Возвращается та же самая ошибка.

Последняя попытка была использовать эту инструкцию https://ru.stackoverflow.com/questions/992815/%D0%9A%D0%B0%D0%BA-%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%82%D1%8C-mysql-8-0-8-0-15-%D0%BD%D0%B0-ubuntu-18-04-%D1%82%D0%B0%D0%BA-%D0%B6%D0%B5-%D0%B4%D0%BB%D1%8F-digitalocean


sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
эрэм эрэф /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
sudo apt update
sudo apt upgrade
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
sudo dpkg -i mysql-apt-config*
apt update
sudo apt update
sudo apt upgrade
sudo apt install mysql-server

В результате та же самая ошибка
Пожста помогите


Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libaio1 libmecab2 mysql-client mysql-common mysql-community-client mysql-community-client-core
  mysql-community-server mysql-community-server-core
Recommended packages:
  mecab-ipadic-utf8
The following NEW packages will be installed:
  libaio1 libmecab2 mysql-client mysql-common mysql-community-client mysql-community-client-core
  mysql-community-server mysql-community-server-core mysql-server
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 23.6 MB of archives.
After this operation, 195 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-common amd64 8.0.20-1ubuntu18.04 [94.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libaio1 amd64 0.3.110-5ubuntu0.1 [6,476 B]
Get:3 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client-core amd64 8.0.20-1ubuntu18.04 [1,707 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libmecab2 amd64 0.996-5 [257 kB]
Get:5 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.20-1ubuntu18.04 [2,834 kB]
Get:6 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-client amd64 8.0.20-1ubuntu18.04 [90.7 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.20-1ubuntu18.04 [18.4 MB]
Get:8 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server amd64 8.0.20-1ubuntu18.04 [102 kB]
Get:9 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-server amd64 8.0.20-1ubuntu18.04 [90.7 kB]
Fetched 23.6 MB in 1s (24.0 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 34325 files and directories currently installed.)
Preparing to unpack .../0-mysql-common_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-common (8.0.20-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client-core.
Preparing to unpack .../1-mysql-community-client-core_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client-core (8.0.20-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client.
Preparing to unpack .../2-mysql-community-client_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client (8.0.20-1ubuntu18.04) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../3-mysql-client_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-client (8.0.20-1ubuntu18.04) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../4-libaio1_0.3.110-5ubuntu0.1_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-5ubuntu0.1) ...
Selecting previously unselected package libmecab2:amd64.
Preparing to unpack .../5-libmecab2_0.996-5_amd64.deb ...
Unpacking libmecab2:amd64 (0.996-5) ...
Selecting previously unselected package mysql-community-server-core.
Preparing to unpack .../6-mysql-community-server-core_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.20-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack .../7-mysql-community-server_8.0.20-1ubuntu18.04_amd64.deb ...
You are required to change your password immediately (root enforced)
chfn: PAM: Authentication token is no longer valid; new one required
adduser: `/usr/bin/chfn -f MySQL Server mysql' returned error code 1. Exiting.
dpkg: error processing archive /tmp/apt-dpkg-install-mMEhYd/7-mysql-community-server_8.0.20-1ubuntu18.04_amd64.deb (--unpack):
 new mysql-community-server package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package mysql-server.
Preparing to unpack .../8-mysql-server_8.0.20-1ubuntu18.04_amd64.deb ...
Unpacking mysql-server (8.0.20-1ubuntu18.04) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-mMEhYd/7-mysql-community-server_8.0.20-1ubuntu18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
После каждой  неуспешной попытки я делаю ребилд сервера чтобы не было мусора.

Спасибо

Dzhoser

  • Гость
sudo apt-get purge .*mariadb.* .*mysql.*sudo apt-get autoremovesudo locate mysqlЭта команда выдаст список оставшихся после удаления файлов/директорий/скриптов прошлых БД. Всех их тоже надо удалить.

sudo apt install mysql-server mysql-client

Оффлайн cegthgtlhj

  • Автор темы
  • Новичок
  • *
  • Сообщений: 11
    • Просмотр профиля
остались следующие хвосты.
Питон нужно удалить?
как удалить последние два хвоста?

root@t-20200417:~# sudo locate mysql
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__init__.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/base.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/features.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/introspection.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/operations.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/schema.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/__init__.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/base.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/features.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/introspection.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/operations.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/contrib/gis/db/backends/mysql/__pycache__/schema.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__init__.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/client.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/compiler.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/creation.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/features.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/introspection.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/operations.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/schema.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/validation.py
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/__init__.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/base.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/client.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/compiler.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/creation.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/features.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/introspection.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/operations.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/schema.cpython-36.pyc
/home/oleg/dj/venv/lib/python3.6/site-packages/django/db/backends/mysql/__pycache__/validation.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__init__.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/base.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/features.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/introspection.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/operations.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/schema.py
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/__init__.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/base.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/features.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/introspection.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/operations.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/contrib/gis/db/backends/mysql/__pycache__/schema.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__init__.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/base.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/client.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/compiler.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/creation.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/features.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/introspection.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/operations.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/schema.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/validation.py
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/__init__.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/base.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/client.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/compiler.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/creation.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/features.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/introspection.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/operations.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/schema.cpython-36.pyc
/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/__pycache__/validation.cpython-36.pyc
/usr/share/bash-completion/completions/mysql
/usr/share/bash-completion/completions/mysqladmin

Оффлайн bezbo

  • Старожил
  • *
  • Сообщений: 1789
    • Просмотр профиля
После каждой  неуспешной попытки я делаю ребилд сервера чтобы не было мусора.

покажите на чистом сервере
sudo apt search mysql-server

Dzhoser

  • Гость
Python удалять не нужно паки dist-packages будет достаточно. В домашнем каталоге тоже можно не удалять

Оффлайн cegthgtlhj

  • Автор темы
  • Новичок
  • *
  • Сообщений: 11
    • Просмотр профиля
Благодарю вас за поддержку.
Мне подсказали следующее.
Пароль юзера истек - необходимо поменять.
Это видно из сообщения об ошибке, которое я не знал как истолковать.

Сделал как написано здесь - ввел пароли еще раз
https://scottlinux.com/2015/03/03/pam-error-authentication-token-is-no-longer-valid/
После этого установился MySQL без проблем
Благодарю вас еще раз

 

Страница сгенерирована за 0.076 секунд. Запросов: 26.