Linux mint удаление mysql

uninstall mysql completely from linux mint [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

I have mysql 5.5 installed in my system and i want to install new version ie. mysql 5.7 , so i am struggling to uninstall the older version. when i will try to install 5.7 ,it is installing 5.5. so i need help . here is the command i executed:-

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5 Reading package lists. Done Building dependency tree Reading state information. Done Package 'mysql-client' is not installed, so not removed Package 'mysql-client-core-5.5' is not installed, so not removed Package 'mysql-common' is not installed, so not removed Package 'mysql-server' is not installed, so not removed Package 'mysql-server-core-5.5' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 254 not upgraded. 
sudo rm -rf /etc/mysql /var/lib/mysql sudo apt-get autoremove Reading package lists. Done Building dependency tree Reading state information. Done 0 upgraded, 0 newly installed, 0 to remove and 254 not upgraded. 
sudo apt-get autoclean Reading package lists. Done Building dependency tree Reading state information. Done $ mysql --version(i jsust tyied to check the version) The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5 Try: sudo apt-get install
sudo apt-get install mysql-server Building dependency tree Reading state information. Done The following extra packages will be installed: libdbd-mysql-perl libdbi-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 Suggested packages: libmldbm-perl libnet-daemon-perl libplrpc-perl libsql-statement-perl tinyca mailx Recommended packages: libhtml-template-perl The following NEW packages will be installed: libdbd-mysql-perl libdbi-perl libmysqlclient18 libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 0 upgraded, 10 newly installed, 0 to remove and 254 not upgraded. Need to get 0 B/9,257 kB of archives. After this operation, 96.4 MB of additional disk space will be used. Do you want to continue? [Y/n] ****** 

Источник

📑 Как полностью удалить MySQL из Ubuntu

Иногда бывает нужно полностью удалить MySQL из Ubuntu. Например для того, чтобы установить вместо нее MariaDB или PerconaDB. Что, впрочем, очень рекомендуется сделать.

Читайте также:  Linux terminal code editor

Для этого нужно остановить сервис MySQL:

Если нужно полностью удалить MySQL из системы, то необходимо использовать следующие команды. С их помощью можно деинсталлировать MySQL server/client пакеты, удалить конфигурационные файлы MySQL, вычистить директорию данных MySQL (т.е. /var/lib/mysql), и удалить из системы пользователя mysql. То-есть вычистить все, относящееся к MySQL.

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common $ sudo apt-get autoremove $ sudo apt-get autoclean

Если нужно только удалить пакеты, относящиеся к MeSQL, но оставить конфигурационные файлы и файлы данных, нужно использовать следующую последовательность команд:

$ sudo apt-get remove mysql-server mysql-client mysql-common $ sudo apt-get autoremove $ sudo apt-get autoclean
  • Шпаргалка основных команд mysql по работе с базой данных и таблицам
  • Настройка удаленного доступа MySQL и MariaDB в Linux Ubuntu
  • Процесс создания базы MySQL, нового пользователя и загрузки дампа
  • Как посмотреть всех пользователей и привилегии в MySQL
  • Проверка, восстановление и оптимизация баз MySQL
  • Установка Nginx, MariaDB и PHP-FPM на Ubuntu 16.04
  • Как полностью удалить MySQL из Ubuntu
  • Удаление всех таблиц из базы MySQL
  • Установка сервера percona
  • Установка Nginx+php5-fpm+MariaDB на Ubuntu 14.04
  • Дампы баз данных MySql — mysqldump
  • Перенос баз данных MySQL
  • Защита phpMyAdmin

Источник

Completely Uninstall MySQL Server in Ubuntu

While package management in Ubuntu, as in most Linux operating systems nowadays, makes it extremely easy to install, upgrade and delete a piece of software, some software is a bit more complex in nature and contains multiple configuration folders, etc.

One such complex software is MySQL Server. Uninstalling MySQL Server does not simply amount to running ‘apt purge‘ as is done usually. There are few small steps you can follow to completely uninstall MySQL Server from your Ubuntu machines.

Backup MySQL Databases in Linux

If you do not have any database created in MySQL, you can skip this step. If you have, before you remove MySQL Server from the system, make sure you take a backup of all your databases, so that when you reinstall it on another system or want to use the database on an existing server, you can simply restore them.

Remove MySQL Server in Ubuntu

The Ubuntu packages for MySQL Server start with ‘mysql-server’ and you can use apt purge command to remove all these packages.

$ sudo apt purge mysql-server*

Remove MySQL Server in Ubuntu

As you can see, it has removed 3 packages that contain files for the server. The reason we use ‘purge‘ instead of ‘remove‘ is that the former removes the configuration files for the program as well, whereas the latter only removes the program binaries.

Remove MySQL Database Files and Logs

The command ‘apt purge‘ does remove the binaries and the configuration files, however, there are some more MySQL configuration files and the database files which are not touched by any package manager.

Читайте также:  Starting named service in linux

The configuration files are present in /etc/mysql and the security keys and other related files are stored in /var/lib/mysql.

$ ls /etc/mysql $ sudo ls /var/lib/mysql

MySQL Configuration Files

Thus, these MySQL configuration files and database files need to be deleted manually.

$ sudo rm -r /etc/mysql /var/lib/mysql

If you have enabled logging for MySQL, make sure you delete the log files as well.

Remove Orphaned Packages Packages

Along with the MySQL Server packages installed by the package manager, there are some packages that are also installed as dependencies for the server. These are no longer required by the system, as the main package itself has been purged. They are also known as ‘Orphaned Packages’.

Run the following apt command to remove such packages.

Remove Packages Installed Automatically

Note that this will remove ALL orphaned packages, not only the ones orphaned by the purging of the MySQL Server. You can see in the output that MySQL Client packages are also being removed, as they are now useless without the server package.

Conclusion

We learned how to completely uninstall MySQL Server in Ubuntu in a few easy steps. Database deletions, upgrades, and installations should be handled with the utmost care, and data should be backed up from time to time, so as to prevent data-related disasters on a personal level or on an organizational level.

Thanks for reading and let us know your thoughts in the comments below!

I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

3 thoughts on “Completely Uninstall MySQL Server in Ubuntu”

Did not work because the system attempts to constantly re-install and then reports in a bad state. dpkg: warning: old mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead .
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action «stop» failed.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb (—unpack):
new mysql-server-8.0 package pre-removal script subprocess returned error exit status 1
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action «stop» failed.
Failed to start mysql.service: Unit mysql.service not found.
invoke-rc.d: initscript mysql, action «start» failed.
Unit mysql.service could not be found.
dpkg: error while cleaning up:
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1) will not install any other updates on the system whilst this loop remains. Reply

Читайте также:  Executing python in linux

If the above command is not fixed, try to force the package installation using the following command.

$ sudo apt install -f OR $ sudo apt install --fix-broken

Источник

Как полностью удалить и установить MySQL в Linux Mint 21

Вы можете использовать различное программное обеспечение для управления данными, и MySQL является одним из них. Это система управления базами данных, которую вы также можете установить в своей системе Linux для управления данными для различных целей. MySQL можно удалить, если он вызывает проблемы с операционной системой Linux Mint. Чтобы узнать, как удалить и снова установить MySQL в Linux Mint 21, следуйте этому руководству.

Как полностью удалить и установить MySQL в Linux Mint 21

Чтобы сначала установить MySQL на Linux Mint, вам необходимо удалить любую его версию, включая другие файлы или зависимости, для этого выполните шаги, указанные ниже:

Шаг 1: Чтобы удалить MySQL, включая все его зависимости, выполните команду, приведенную ниже:

судо удалить —удалять mysql *

Шаг 2: Чтобы удалить MySQL, включая все его зависимости, выполните команду, приведенную ниже:

судо apt-получить очистку mysql *

Шаг 3: Чтобы удалить MySQL и оставшиеся файлы, выполните команду, приведенную ниже:

судо apt-получить автоматическое удаление

Шаг 4: Чтобы очистить локальный репозиторий, выполните команду, приведенную ниже:

судо apt-получить автоочистку

Шаг 5: Чтобы очистить базы данных, созданные во время установки, выполните команду, приведенную ниже:

судо удалить dbconfig-mysql

Шаг 6: Теперь заходим в браузер и скачать MySQL для вашего Linux Mint:

Вам будет предложено зарегистрировать учетную запись, но вы можете пропустить это, нажав на кнопку Нет, спасибо, просто начните загрузку.

Шаг 7: Теперь, чтобы установить только что загруженный файл deb, выполните команду, указанную ниже:

судо дпкг -я mysql-apt-config_0.8.24- 1 _all.deb

Шаг 8: Выполните следующую команду, чтобы перейти в корень:

Шаг 9: Теперь настройте MySQL, выполнив команду, указанную ниже, а затем нажмите клавишу ввода после выполнения:

Шаг 10: Нажимать Входить продолжать:

Шаг 11: Теперь выберите версию MySQL и нажмите Входить:

Шаг 12: Теперь обновите свою систему, выполнив команду, указанную ниже:

судо apt-получить обновление

Шаг 13: Вы можете установить сервер MySQL, выполнив приведенную ниже команду:

судо apt-получить установку mysql-сервер

Шаг 14: Чтобы проверить состояние сервера MySQL, выполните приведенную ниже команду:

Шаг 15: Чтобы проверить версию mysql, которую вы только что установили, выполните команду, приведенную ниже:

Заключение

Вы можете создать базу данных для управления любым типом данных, которые вы хотите, используя MySQL. Большую часть времени вам нужна система управления базами данных, когда у вас есть большой объем данных, например, в корпоративных секторах. В этом руководстве мы обсудили, как мы можем полностью удалить MySQL и снова установить ее в Linux Mint 21.

Источник

Оцените статью
Adblock
detector