Mengupdate package
Shell
x
1
1
sudo apt update
Contoh hasil output
Shell
1
11
11
1
root@cloud-dev:~# apt update
2
Hit:1 http://id.archive.ubuntu.com/ubuntu focal InRelease
3
Get:2 http://id.archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB]
4
Hit:3 http://id.archive.ubuntu.com/ubuntu focal-backports InRelease
5
Hit:4 http://id.archive.ubuntu.com/ubuntu focal-security InRelease
6
Fetched 128 kB in 1s (157 kB/s)
7
Reading package lists... Done
8
Building dependency tree
9
Reading state information... Done
10
104 packages can be upgraded. Run 'apt list --upgradable' to see them.
11
root@cloud-dev:~#
Menginstall mariadb-server
Shell
1
2
1
sudo apt install mariadb-server
2
Contoh hasil output
Shell
1
24
24
1
root@cloud-dev:~# apt install mariadb-server
2
Reading package lists... Done
3
Building dependency tree
4
Reading state information... Done
5
The following additional packages will be installed:
6
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
7
libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3
8
mariadb-common mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat
9
Suggested packages:
10
libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx mariadb-test tinyca
11
The following NEW packages will be installed:
12
galera-3 libcgi-fast-perl libcgi-pm-perl libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
13
libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmysqlclient21 libsnappy1v5 libterm-readkey-perl libtimedate-perl liburi-perl mariadb-client-10.3 mariadb-client-core-10.3
14
mariadb-common mariadb-server mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat
15
0 upgraded, 28 newly installed, 0 to remove and 104 not upgraded.
16
Need to get 21.5 MB of archives.
17
After this operation, 175 MB of additional disk space will be used.
18
Do you want to continue? [Y/n] Y
19
Get:1 http://id.archive.ubuntu.com/ubuntu focal/main amd64 mysql-common all 5.8+1.0.5ubuntu2 [7,496 B]
20
....
21
....
22
Processing triggers for man-db (2.9.1-1) ...
23
Processing triggers for libc-bin (2.31-0ubuntu9.16) ...
24
root@cloud-dev:~#
Menyalakan service mariadb
Shell
1
2
1
sudo systemctl start mariadb
2
sudo systemctl status mariadb
Contoh hasil output
Shell
1
29
29
1
root@cloud-dev:~# systemctl start mariadb
2
root@cloud-dev:~# systemctl status mariadb
3
● mariadb.service - MariaDB 10.3.39 database server
4
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
5
Active: active (running) since Wed 2024-07-17 13:46:55 UTC; 2s ago
6
Docs: man:mysqld(8)
7
https://mariadb.com/kb/en/library/systemd/
8
Process: 1941123 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
9
Process: 1941124 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
10
Process: 1941137 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VA>
11
Process: 1941216 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
12
Process: 1941218 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
13
Main PID: 1941184 (mysqld)
14
Status: "Taking your SQL requests now..."
15
Tasks: 31 (limit: 9425)
16
Memory: 65.3M
17
CGroup: /system.slice/mariadb.service
18
└─1941184 /usr/sbin/mysqld
19
20
Jul 17 13:46:55 cloud-dev systemd[1]: Starting MariaDB 10.3.39 database server...
21
Jul 17 13:46:55 cloud-dev systemd[1]: Started MariaDB 10.3.39 database server.
22
Jul 17 13:46:55 cloud-dev /etc/mysql/debian-start[1941223]: Looking for 'mysql' as: /usr/bin/mysql
23
Jul 17 13:46:55 cloud-dev /etc/mysql/debian-start[1941223]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
24
Jul 17 13:46:55 cloud-dev /etc/mysql/debian-start[1941223]: This installation of MariaDB is already upgraded to 10.3.39-MariaDB.
25
Jul 17 13:46:55 cloud-dev /etc/mysql/debian-start[1941223]: There is no need to run mysql_upgrade again for 10.3.39-MariaDB.
26
Jul 17 13:46:55 cloud-dev /etc/mysql/debian-start[1941223]: You can use --force if you still want to run mysql_upgrade
27
28
root@cloud-dev:~#
29
Mengamankan instalasi mariadb
Shell
1
1
1
sudo mysql_secure_installation
Contoh hasil output
Shell
1
63
63
1
root@cloud-dev:~# mysql_secure_installation
2
3
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
4
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
5
6
In order to log into MariaDB to secure it, we'll need the current
7
password for the root user. If you've just installed MariaDB, and
8
you haven't set the root password yet, the password will be blank,
9
so you should just press enter here.
10
11
Enter current password for root (enter for none):
12
OK, successfully used password, moving on...
13
14
Setting the root password ensures that nobody can log into the MariaDB
15
root user without the proper authorisation.
16
17
Set root password? [Y/n]
18
New password:
19
Re-enter new password:
20
Password updated successfully!
21
Reloading privilege tables..
22
... Success!
23
24
25
By default, a MariaDB installation has an anonymous user, allowing anyone
26
to log into MariaDB without having to have a user account created for
27
them. This is intended only for testing, and to make the installation
28
go a bit smoother. You should remove them before moving into a
29
production environment.
30
31
Remove anonymous users? [Y/n] Y
32
... Success!
33
34
Normally, root should only be allowed to connect from 'localhost'. This
35
ensures that someone cannot guess at the root password from the network.
36
37
Disallow root login remotely? [Y/n] Y
38
... Success!
39
40
By default, MariaDB comes with a database named 'test' that anyone can
41
access. This is also intended only for testing, and should be removed
42
before moving into a production environment.
43
44
Remove test database and access to it? [Y/n] Y
45
- Dropping test database...
46
... Success!
47
- Removing privileges on test database...
48
... Success!
49
50
Reloading the privilege tables will ensure that all changes made so far
51
will take effect immediately.
52
53
Reload privilege tables now? [Y/n] Y
54
... Success!
55
56
Cleaning up...
57
58
All done! If you've completed all of the above steps, your MariaDB
59
installation should now be secure.
60
61
Thanks for using MariaDB!
62
root@cloud-dev:~#
63