Hướng dẫn uninstall mysql redhat 7

Uninstalling or removing MySQL Server from Linux Centos or RHEL is pretty easy. Let's check the MySQL Service first if it is running and active.

sudo systemctl status mysqld

It should show you that the service is active and running.

Now to uninstall MySQL from RHEL or Centos, run below command

sudo  yum remove mysql

The above command will run the uninstallation process and ask you if you are sure to remove MySQL Server. type y and it will remove MySQL Client and MySQL Server. To make sure the MySQL Server is removed from Linux machine, you can run

sudo systemctl status mysqld

It should return you message that service does not exists.

How to uninstall MySQL Server from Linux

Tiếp theo sau bài viết huỡng dẫn cài đặt mariadb trên centos mình sẽ huỡng dẫn các bạn cách thay thế Mysql bằng Mariadb trên Centos [chú ý : bài viết này chỉ áp dụng cho các bạn cần đến nó, và mình cũng không bàn luận về việc tại sao đang dùng Mysql mà phải thay thế sang Mariadb]

B1: Đầu tiên chúng ta cần làm là backup toàn bộ dữ liệu đang có trong Mysql ra

# mysqldump -u root -p –all-databases > /tmp/backup-all-db.sql

B2: Tiếp, gỡ các gói cài đặt Mysql

# service mysqld stop

# cp /etc/my.cnf /tmp/

# yum remove mysql*

B3: Cài đặt Mariadb 

Xem huỡng dẫn tại đây

Sau khi cài đặt xong, ta tiến hành copy lại file cấu hình vừa backup

# cp /tmp/my.cnf /etc/my.cnf

# service mysqld start

B4: Restore lại database

# mysql –u root –p

Chủ Đề