Kami menggunakan MariaDB sebagai server database untuk menggantikan MySQL, karena MySQL sudah deprecated dan tidak up-to-date lagi. Gunakan perintah berikut:
root@debian:/usr/src/csf# apt-get install mariadb-server -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
galera-3 gawk libaio1 libcgi-fast-perl libcgi-pm-perl
libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libfcgi-perl
libhtml-template-perl libreadline5 libsigsegv2 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server-10.3
mariadb-server-core-10.3 rsync socat
Suggested packages:
gawk-doc libclone-perl libmldbm-perl libnet-daemon-perl
libsql-statement-perl libipc-sharedcache-perl mailx mariadb-test
netcat-openbsd tinyca
The following NEW packages will be installed:
galera-3 gawk libaio1 libcgi-fast-perl libcgi-pm-perl
libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libfcgi-perl
libhtml-template-perl libreadline5 libsigsegv2 libterm-readkey-perl
mariadb-client-10.3 mariadb-client-core-10.3 mariadb-server
mariadb-server-10.3 mariadb-server-core-10.3 rsync socat
0 upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.9 MB of archives.
After this operation, 167 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libsigsegv2 amd64 2.12-2 [32.8 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 gawk amd64 1:4.2.1+dfsg-1 [660 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 galera-3 amd64 25.3.25-2 [920 kB]
Get:4 http://deb.debian.org/debian buster/main amd64 libdbi-perl amd64 1.642-1+deb10u2 [775 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 libconfig-inifiles-perl all 3.000001-1 [51.9 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 libaio1 amd64 0.3.112-3 [11.2 kB]
Get:7 http://deb.debian.org/debian buster/main amd64 libreadline5 amd64 5.2+dfsg-3+b13 [120 kB]
Get:8 http://deb.debian.org/debian buster/main amd64 mariadb-client-core-10.3 amd64 1:10.3.31-0+deb10u1 [5752 kB]
Get:9 http://deb.debian.org/debian buster/main amd64 mariadb-client-10.3 amd64 1:10.3.31-0+deb10u1 [1146 kB]
Get:10 http://deb.debian.org/debian buster/main amd64 mariadb-server-core-10.3 amd64 1:10.3.31-0+deb10u1 [5961 kB]
Get:11 http://deb.debian.org/debian buster/main amd64 rsync amd64 3.1.3-6 [397 kB]
Get:12 http://deb.debian.org/debian buster/main amd64 socat amd64 1.7.3.2-2 [358 kB]
Get:13 http://deb.debian.org/debian buster/main amd64 mariadb-server-10.3 amd64 1:10.3.31-0+deb10u1 [4213 kB]
Get:14 http://deb.debian.org/debian buster/main amd64 libcgi-pm-perl all 4.40-1 [222 kB]
Get:15 http://deb.debian.org/debian buster/main amd64 libfcgi-perl amd64 0.78-2+b3 [39.0 kB]
Get:16 http://deb.debian.org/debian buster/main amd64 libcgi-fast-perl all 1:2.13-1 [11.4 kB]
Get:17 http://deb.debian.org/debian buster/main amd64 libdbd-mysql-perl amd64 4.050-2 [121 kB]
Get:18 http://deb.debian.org/debian buster/main amd64 libhtml-template-perl all 2.97-1 [66.0 kB]
Get:19 http://deb.debian.org/debian buster/main amd64 libterm-readkey-perl amd64 2.38-1 [27.4 kB]
Get:20 http://deb.debian.org/debian buster/main amd64 mariadb-server all 1:10.3.31-0+deb10u1 [31.7 kB]
Fetched 20.9 MB in 1s (19.8 MB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "id_ID.UTF-8",
LC_MONETARY = "id_ID.UTF-8",
LC_ADDRESS = "id_ID.UTF-8",
LC_TELEPHONE = "id_ID.UTF-8",
LC_NAME = "id_ID.UTF-8",
LC_MEASUREMENT = "id_ID.UTF-8",
LC_IDENTIFICATION = "id_ID.UTF-8",
LC_NUMERIC = "id_ID.UTF-8",
LC_PAPER = "id_ID.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 126439 files and directories currently installed.)
Preparing to unpack .../libsigsegv2_2.12-2_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.12-2) ...
Setting up libsigsegv2:amd64 (2.12-2) ...
Selecting previously unselected package gawk.
(Reading database ... 126448 files and directories currently installed.)
Preparing to unpack .../00-gawk_1%3a4.2.1+dfsg-1_amd64.deb ...
Unpacking gawk (1:4.2.1+dfsg-1) ...
Selecting previously unselected package galera-3.
Preparing to unpack .../01-galera-3_25.3.25-2_amd64.deb ...
Unpacking galera-3 (25.3.25-2) ...
Selecting previously unselected package libdbi-perl:amd64.
Preparing to unpack .../02-libdbi-perl_1.642-1+deb10u2_amd64.deb ...
Unpacking libdbi-perl:amd64 (1.642-1+deb10u2) ...
Selecting previously unselected package libconfig-inifiles-perl.
Preparing to unpack .../03-libconfig-inifiles-perl_3.000001-1_all.deb ...
Unpacking libconfig-inifiles-perl (3.000001-1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../04-libaio1_0.3.112-3_amd64.deb ...
Unpacking libaio1:amd64 (0.3.112-3) ...
Selecting previously unselected package libreadline5:amd64.
Preparing to unpack .../05-libreadline5_5.2+dfsg-3+b13_amd64.deb ...
Unpacking libreadline5:amd64 (5.2+dfsg-3+b13) ...
Selecting previously unselected package mariadb-client-core-10.3.
Preparing to unpack .../06-mariadb-client-core-10.3_1%3a10.3.31-0+deb10u1_amd64.deb ...
Unpacking mariadb-client-core-10.3 (1:10.3.31-0+deb10u1) ...
Selecting previously unselected package mariadb-client-10.3.
Preparing to unpack .../07-mariadb-client-10.3_1%3a10.3.31-0+deb10u1_amd64.deb ...
Unpacking mariadb-client-10.3 (1:10.3.31-0+deb10u1) ...
Selecting previously unselected package mariadb-server-core-10.3.
Preparing to unpack .../08-mariadb-server-core-10.3_1%3a10.3.31-0+deb10u1_amd64.deb ...
Unpacking mariadb-server-core-10.3 (1:10.3.31-0+deb10u1) ...
Selecting previously unselected package rsync.
Preparing to unpack .../09-rsync_3.1.3-6_amd64.deb ...
Unpacking rsync (3.1.3-6) ...
Selecting previously unselected package socat.
Preparing to unpack .../10-socat_1.7.3.2-2_amd64.deb ...
Unpacking socat (1.7.3.2-2) ...
Selecting previously unselected package mariadb-server-10.3.
Preparing to unpack .../11-mariadb-server-10.3_1%3a10.3.31-0+deb10u1_amd64.deb ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Unpacking mariadb-server-10.3 (1:10.3.31-0+deb10u1) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../12-libcgi-pm-perl_4.40-1_all.deb ...
Unpacking libcgi-pm-perl (4.40-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../13-libfcgi-perl_0.78-2+b3_amd64.deb ...
Unpacking libfcgi-perl (0.78-2+b3) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../14-libcgi-fast-perl_1%3a2.13-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.13-1) ...
Selecting previously unselected package libdbd-mysql-perl:amd64.
Preparing to unpack .../15-libdbd-mysql-perl_4.050-2_amd64.deb ...
Unpacking libdbd-mysql-perl:amd64 (4.050-2) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../16-libhtml-template-perl_2.97-1_all.deb ...
Unpacking libhtml-template-perl (2.97-1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../17-libterm-readkey-perl_2.38-1_amd64.deb ...
Unpacking libterm-readkey-perl (2.38-1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../18-mariadb-server_1%3a10.3.31-0+deb10u1_all.deb ...
Unpacking mariadb-server (1:10.3.31-0+deb10u1) ...
Setting up libconfig-inifiles-perl (3.000001-1) ...
Setting up libreadline5:amd64 (5.2+dfsg-3+b13) ...
Setting up gawk (1:4.2.1+dfsg-1) ...
Setting up libcgi-pm-perl (4.40-1) ...
Setting up libhtml-template-perl (2.97-1) ...
Setting up socat (1.7.3.2-2) ...
Setting up galera-3 (25.3.25-2) ...
Setting up libfcgi-perl (0.78-2+b3) ...
Setting up libterm-readkey-perl (2.38-1) ...
Setting up libaio1:amd64 (0.3.112-3) ...
Setting up libdbi-perl:amd64 (1.642-1+deb10u2) ...
Setting up rsync (3.1.3-6) ...
Created symlink /etc/systemd/system/multi-user.target.wants/rsync.service → /lib/systemd/system/rsync.service.
Setting up libcgi-fast-perl (1:2.13-1) ...
Setting up mariadb-server-core-10.3 (1:10.3.31-0+deb10u1) ...
Setting up libdbd-mysql-perl:amd64 (4.050-2) ...
Setting up mariadb-client-core-10.3 (1:10.3.31-0+deb10u1) ...
Setting up mariadb-client-10.3 (1:10.3.31-0+deb10u1) ...
Setting up mariadb-server-10.3 (1:10.3.31-0+deb10u1) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
Setting up mariadb-server (1:10.3.31-0+deb10u1) ...
Processing triggers for systemd (241-7~deb10u8) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
root@debian:/usr/src/csf# cd
root@debian:~# apt-get install mariadb-server -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
mariadb-server is already the newest version (1:10.3.31-0+deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@debian:~# systemctl enable mariadb
root@debian:~# systemctl start mariadb
Jangan lupa untuk mengecek status MariaDB, apakah sudah running atau belum.
oot@debian:~# systemctl status mariadb
● mariadb.service - MariaDB 10.3.31 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor pr
Active: active (running) since Fri 2021-12-10 08:36:16 WITA; 6min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 3072 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 4529)
Memory: 71.4M
CGroup: /system.slice/mariadb.service
└─3072 /usr/sbin/mysqld
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: performance_schema
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: Phase 6/7: Checking
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: Running 'mysqlcheck'
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: # Connecting to loca
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: # Disconnecting from
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: Processing databases
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: information_schema
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: performance_schema
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: Phase 7/7: Running '
Dec 10 08:36:21 debian /etc/mysql/debian-start[3110]: OK
lines 1-22/22 (END)
Gunakan command di bawah ini untuk memulai inisialisasi setup MariaDB.
root@debian:~# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): [tekan enter saja]
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set 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
... Success!
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] y
... Success!
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...
... Success!
- Removing privileges on test database...
... Success!
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!
0 comments:
Post a Comment