Ubuntu 26.04 MariaDB Install / Uninstall
1. Install
2. Uninstall
Install
$ sudo apt install mariadb-server mariadb-client
[ Execution log ]
gangserver@TCM73-U0424:~$ sudo apt install mariadb-server mariadb-client
[sudo: authenticate] 비밀번호:
설치할 패키지:
mariadb-client mariadb-server
설치할 의존성 패키지:
galera-4 libfcgi-bin mariadb-client-core mariadb-plugin-provider-snappy
gawk libfcgi-perl mariadb-common mariadb-server-core
libaio1t64 libfcgi0t64 mariadb-plugin-provider-bzip2 mysql-common
libcgi-fast-perl libhtml-template-perl mariadb-plugin-provider-lz4 pv
libcgi-pm-perl libmariadb3 mariadb-plugin-provider-lzma
libdbi-perl libpcre2-posix3 mariadb-plugin-provider-lzo
제안하는 패키지:
gawk-doc libsql-statement-perl | libdbd-mysql-perl mariadb-test
libmldbm-perl libipc-sharedcache-perl libterm-readkey-perl doc-base
libnet-daemon-perl libdbd-mariadb-perl mailx
요약:
업그레이드: 0, 설치: 24, 삭제: 0, 업그레이드 안 함: 0
다운로드 크기: 17.8 MB
필요한 공간: 127 MB / 1,543 MB 사용 가능
계속하시겠습니까? [Y/n] y
(... Log omitted ...)
내려받기 17.8 M바이트, 소요시간 4초 (4,504 k바이트/초)
패키지를 미리 설정하는 중입니다...
(데이터베이스 읽는중 ...현재 267812개의 파일과 디렉터리가 설치되어 있습니다.)
(... Log omitted ...)
- Check installation version
$ mariadb --version
[ Execution log ]
gangserver@TCM73-U0424:~$ mariadb --version
mariadb from 11.8.6-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
- Start MariaDB service on boot and start MariaDB service immediately
$ sudo systemctl enable --now mariadb
or
$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb
[ Execution log ]
gangserver@TCM73-U0424:~$ sudo systemctl enable --now mariadb
Synchronizing state of mariadb.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable mariadb
or
gangserver@TCM73-U0424:~$ sudo systemctl enable mariadb
Synchronizing state of mariadb.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable mariadb
Created symlink '/etc/systemd/system/multi-user.target.wants/mariadb.service' → '/usr/lib/systemd/system/mariadb.service'.
gangserver@TCM73-U0424:~$ sudo systemctl start mariadb
gangserver@TCM73-U0424:~$
- Check MariaDB processes
$ ps -ef | grep mysql
[ Execution log ]
gangserver@TCM73-U0424:~$ ps -ef | grep mysql
mysql 24897 1 4 01:12 ? 00:00:02 /usr/sbin/mariadbd
gangser+ 25008 23163 0 01:13 pts/1 00:00:00 grep --color=auto mysql
- Initial settings
$ sudo mariadb-secure-installation
[ Execution log ]
gangserver@TCM73-U0424:~$ sudo mariadb-secure-installation
NOTE: MariaDB is secure by default in Debian. Running this script is
useless at best, and misleading at worst. This script will be
removed in a future MariaDB release in Debian. Please read
/usr/share/doc/mariadb-server/README.Debian.gz for details.
Enter root user password or leave blank:
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
SQL executed without errors!
The operation might have been successful, or it might have not done anything.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
SQL executed without errors!
The operation might have been successful, or it might have not done anything.
- Removing privileges on test database...
SQL executed without errors!
The operation might have been successful, or it might have not done anything.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Uninstall
$ sudo apt remove mariadb-server mariadb-client
$ sudo apt autoremove -y
[ Execution log ]
gangserver@TCM73-U0424:~$ sudo apt remove mariadb-server mariadb-client
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
galera-4 libcgi-pm-perl libfcgi-perl libmariadb3 mariadb-common mariadb-plugin-provider-lzma mariadb-server-core
libaio1t64 libdbi-perl libfcgi0t64 libpcre2-posix3 mariadb-plugin-provider-bzip2 mariadb-plugin-provider-lzo mysql-common
libcgi-fast-perl libfcgi-bin libhtml-template-perl mariadb-client-core mariadb-plugin-provider-lz4 mariadb-plugin-provider-snappy pv
'sudo apt autoremove'를 이용하여 제거하십시오.
제거할 패키지:
mariadb-client mariadb-server
요약:
업그레이드: 0, 설치: 0, 삭제: 2, 업그레이드 안 함: 0
비워진 공간: 71.2 MB
계속하시겠습니까? [Y/n] y
(데이터베이스 읽는중 ...현재 268601개의 파일과 디렉터리가 설치되어 있습니다.)
mariadb-server (1:11.8.6-5)를 제거합니다...
mariadb-client (1:11.8.6-5)를 제거합니다...
Processing triggers for man-db (2.13.1-1build1) ...
gangserver@TCM73-U0424:~$ sudo apt autoremove -y
제거할 패키지:
galera-4 libcgi-pm-perl libfcgi-perl libmariadb3 mariadb-common mariadb-plugin-provider-lzma mariadb-server-core
libaio1t64 libdbi-perl libfcgi0t64 libpcre2-posix3 mariadb-plugin-provider-bzip2 mariadb-plugin-provider-lzo mysql-common
libcgi-fast-perl libfcgi-bin libhtml-template-perl mariadb-client-core mariadb-plugin-provider-lz4 mariadb-plugin-provider-snappy pv
요약:
업그레이드: 0, 설치: 0, 삭제: 21, 업그레이드 안 함: 0
비워진 공간: 53.5 MB
(데이터베이스 읽는중 ...현재 268430개의 파일과 디렉터리가 설치되어 있습니다.)
(... Log omitted ...)