Полностью удалите MariaDB или MySQL из CentOS 7 или RHEL 7
Я установил MariaDB на CentOS 7, но у меня были некоторые проблемы с некоторой конфигурацией, теперь он полностью неправильно сконфигурирован.
Таким образом, я хотел удалить MariaDB с помощью «yum remove mariadb mariadb-server», после чего я переустановил его с помощью «yum install mariadb mariadb-server».
К сожалению, конфигурация остается. Кажется, что yum remove не удаляет все конфигурационные файлы MariaDB.
Как полностью удалить MariaDB из CentOS 7?
Эти шаги работают над CentOS 6.5, поэтому они также должны работать на CentOS 7:
- yum remove mariadb mariadb-server
- rm -rf /var/lib/mysql Если ваш datadir в /etc/my.cnf указывает на другой каталог, удалите этот каталог вместо /var/lib/mysql
- rm /etc/my.cnf
- Дополнительный шаг: rm
[ EDIT] — Обновление для MariaDB 10.1 на CentOS 7
Вышеупомянутые шаги работали для CentOS 6.5 и MariaDB 10.
Я только что установил MariaDB 10.1 на CentOS 7, и некоторые из этих шагов немного отличаются.
How do I completely remove MySQL from a linux installation?
I was surprised to find that one of my privileged users installed MySQL on a linux box. The server (mysqld) is running and doing nothing. My skills are all in Oracle, so I am unfamiliar with how to shutdown and remove the MySQL installation.
6 Answers 6
You didn’t mention what distribution you are using, but if they installed it via yum on a RedHat based distribution you can remove with:
If they installed it in their own user space you would just remove the binary files that are running the server. If it is on Debian/Ubuntu you would use the method sparks mentioned. I would also alternatively use:
It all depends on how the original user installed the package. If they used the operating system’s built in package management, it should be as easy as the yum line in Dave’s answer or on a Debian-based system (including Ubuntu), you can use:
(As an aside, use purge instead of remove if you also want to remove custom configuration files)
If you don’t know the exact package name to remove on Ubuntu:
If the user in question did not use a package management tool, then the only real solution is to simply ensure that the server doesn’t load on startup (chkconfig or update-rc.d are two handy tools for that — check their man pages) and manually remove all the installed files.
If the user happened to set up any databases, you might need to remove those as well. In package base installation of MySQL, the table files can be found in /var/lib/mysql . If they are elsewhere, you can just search for the table files. They will have a .frm extension, and should be contained in a directory named after the database they are associated with.
Depending on your distribution you should have the option to shut it down with an init script in «/etc/init.d/mysql stop». If this fails you can kill the processes with something similar to «for i in ps -ef |grep mysqld |awk ‘
It will really be dependent on how they installed it for how you removed it. If you are running a debian based distribution: «sudo apt-get remove mysqld»
Per Zoredache’s comment you can also do:»sudo apt-get purge mysqld» which would also remove configuration files.
Maybe the user himself doesn’t know that he installed mysql. It can happen if mysql is a dependency of some other program. Have a look at the package manager logfile, ex: for a redhat check /var/log/yum.log. You will probably find some more packages installed at the same time. You can then deduce what the user wanted to do, and maybe you also want to remove some other packages too that you weren’t aware of the installation!
On a recent redhat you can for example run «yum history list», then after you found the date of installation in /var/log/yum.log, you can deduce which yum operation was related to the mysql installation, and you can for example «yum history info operation_number» to get details of the installation, or «yum history undo operation_number» to revert the operation and uninstall the related packages.
Maybe the user himself doesn’t know that he installed mysql. It can happen if mysql is a dependency of some other program. Have a look at the package manager logfile, ex: for a redhat check /var/log/yum.log . You will probably find some more packages installed at the same time. You can then deduce what the user wanted to do, and maybe you also want to remove some other packages too that you weren’t aware of the installation!
The Overflow Blog
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.3.3.43278
How to Remove MySQL Entirely from Linux System(CentOs)
Next, you need to remove MySQL data directory from system which by default exists at /var/lib/mysql. If you didn’t find this, It may be changed to some other place, which you can find in my.cnf file with variable datadir. Delete the /var/lib/mysql directory from system but we prefer to rename it to keep a backup of existing files.
Step 3: Install MySQL Packages Again
After removing MySQL completely, install it again using yum package manager, It will re create mysql directory under /var/lib/.
If go through these steps, you will have a fresh MySQL install on your system with new settings.
Published by Cephas Ahiaku
Objective: To Provide secure and reliable IT services to organizations and communities. Education BSc. Administration (Business information system), Experience: Network adninistrator, University of Education, Winneba, Ghana Assistant IT Specialist, Distance Learning Center – , Ghana IT Capabilities: Installation, Configuration, and Administration of the following servers: Apache OpenLDAP Squid Moodle CentOS View all posts by Cephas Ahiaku
How to Completely Remove and Install MariaDB 10.1.39v on CentOS 7.6
Mariadb is a database that stores the information in the form of tables.
What is the user that mariadb has by default on centOS 7.6?
mysql is the MAriadb user has by default on centos 7.6
What is the command to delete the mariadb user on centos 7.6?
userdel -r mysql is the command to delete the mariadb user on centos 7.6
Why was MariaDB created ?
It was primarily developed due to concerns that arose when MySQL was acquired by ORACLE Inc.MAriaDB is a general purpose DBMS engineered with extensible architecture to support a broad set of use cases via pluggable storage engines.
Are the commands in Mariadb similar in MYSQL?
Yes.the mariadb commands are similar in mysql
report this ad
I can't format my flash drive to EXT4 without receiving this error, followed by it becoming read only and fighting with me until I clear it. Can someone help me troubleshoot this? Is this an issue with the flash drive or my BIOS? Is this fixable, or do I need a different flash drive? How do I know this won't happen on a new flash drive?
The full error is: 64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -0 64bit to rectify.
I'm trying to install POP OS! to run off a flash drive btw. Using a separate installer flash drive to install onto this one. This is the one issue that has kept me from doing so, and took me literal weeks (almost months) to get this far.