Konfiguracija sustava za upravljanje bazom podataka MariaDB - GASERI


MariaDB (Wikipedia) je sustav za upravljanje relacijskom bazom podataka, razvijan od strane zajednice i komercijalno podržan. Razvoj MariaDB-a započet je odvajanjem od MySQL-a izvedenim od strane nekolicine izvornih programera MySQL-a zbog ...



Onion Details



Page Clicks: 0

First Seen: 03/15/2024

Last Indexed: 10/23/2024

Domain Index Total: 397



Onion Content



Preskoči na sadržaj Konfiguracija sustava za upravljanje bazom podataka MariaDB ( Wikipedia ) je sustav za upravljanje relacijskom bazom podataka, razvijan od strane zajednice i komercijalno podržan. Razvoj MariaDB-a započet je odvajanjem od MySQL-a izvedenim od strane nekolicine izvornih programera MySQL-a zbog zabrinutosti oko njegove budućnosti povodom akvizicije Suna od strane Oraclea . Prvenstveni cilj stvaranja projekta neovisnog o Oracleu je želja da softvera ostane slobodan i otvorenog koda pod licencom GNU General Public License. MariaDB zadržava visok nivo kompatibilnosti s MySQL-om, ali proširuje njegovu funkcionalnost tako da nudi i značajke koje MySQL nema. Kao i MySQL , MariaDB je ponuđena i u obliku usluge u oblaku (drugim riječima, sustava koji netko drugi održava) pod imenom SkySQL . Ime MariaDB dao je autor MySQL-a Michael "Monty" Widenius prema svojoj mlađoj kćeri koja se zove Maria. Slično tome, ime MySQL dao je prema imenu starije kćeri koja se zove My. Note Kako MariaDB zadržava što je moguće veću razinu kompatibilnosti s MySQL-om, uočit ćemo kako se u naredbama ljuske, konfiguracijskim naredbama i nazivima datoteka na mnogo mjesta može koristiti naziv MySQL umjesto MariaDB. Primjerice, klijent sučelja naredbenog retka dostupan je naredbama mariadb i mysql , a poslužitelj naredbama mariadbd (MariaDB daemon) i mysqld (MySQL daemon). Slika mariadb na Docker Hubu Sustav za upravljanje bazom podataka MariaDB koristit ćemo u obliku Docker kontejnera . Na Docker Hubu moguće je pronaći sliku mariadb , koja je jedna od službenih slika . Koristit ćemo verziju 10.11 , koja je posljednja izdana stabilna verzija. Pokretanje kontejnera maridab izvodimo naredbom docker run : $ docker run mariadb:10.11 Unable to find image 'mariadb:10.11' locally 10 .11: Pulling from library/mariadb 1bc677758ad7: Pull complete 196e1740aea4: Pull complete 3d4df0997938: Pull complete 9fa4e4184824: Pull complete 22001c5fbbed: Pull complete 49ed08e2853d: Pull complete ca39212f2f3c: Pull complete 439f9b904603: Pull complete Digest: sha256:1c33370a599c870eab28891191b1fc5f46ddf8dfd90bd5f56b03e8a16e83f2fb Status: Downloaded newer image for mariadb:10.11 2023 -05-10 16 :12:11+00:00 [ Note ] [ Entrypoint ] : Entrypoint script for MariaDB Server 1 :10.11.2+maria~ubu2204 started. 2023 -05-10 16 :12:11+00:00 [ Note ] [ Entrypoint ] : Switching to dedicated user 'mysql' 2023 -05-10 16 :12:11+00:00 [ Note ] [ Entrypoint ] : Entrypoint script for MariaDB Server 1 :10.11.2+maria~ubu2204 started. 2023 -05-10 16 :12:11+00:00 [ ERROR ] [ Entrypoint ] : Database is uninitialized and password option is not specified You need to specify one of MARIADB_ROOT_PASSWORD, MARIADB_ALLOW_EMPTY_ROOT_PASSWORD and MARIADB_RANDOM_ROOT_PASSWORD Docker slika ne dozvoljava pokretanje bez navođenja zaporke korijenskog korisnika koja će se korstiti. Navedimo ju putem varijable okoline MARIADB_ROOT_PASSWORD parametrom --env i dodajmo parametar --detach kako bismo zadržali mogućnost daljnjeg rada u terminalu: $ docker run --detach --env MARIADB_ROOT_PASSWORD = m0j4z4p0rk4 mariadb:10.11 b618846ff70c0012813dc62c02a3e262f29d0ac6e54d4504ff042914e7f6d9e9 Naredbom docker ps možemo se uvjeriti da je kontejner pokrenut: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b618846ff70c mariadb:10.11 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 3306 /tcp sleepy_poincare Naredbom docker logs koja kao argument prima identifikator kontejnera možemo se uvjeriti da je pokretanje poslužitelja bilo uspješno: $ docker logs b618846ff70c0012813dc62c02a3e262f29d0ac6e54d4504ff042914e7f6d9e9 2023 -05-10 16 :12:56+00:00 [ Note ] [ Entrypoint ] : Entrypoint script for MariaDB Server 1 :10.11.2+maria~ubu2204 started. 2023 -05-10 16 :12:56+00:00 [ Note ] [ Entrypoint ] : Switching to dedicated user 'mysql' 2023 -05-10 16 :12:56+00:00 [ Note ] [ Entrypoint ] : Entrypoint script for MariaDB Server 1 :10.11.2+maria~ubu2204 started. 2023 -05-10 16 :12:56+00:00 [ Note ] [ Entrypoint ] : Initializing database files PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! To do so, start the server, then issue the following command: '/usr/bin/mariadb-secure-installation' which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the MariaDB Knowledgebase at https://mariadb.com/kb Please report any problems at https://mariadb.org/jira The latest information about MariaDB is available at https://mariadb.org/. Consider joining MariaDB 's strong and vibrant community: https://mariadb.org/get-involved/ 2023-05-10 16:12:58+00:00 [Note] [Entrypoint]: Database files initialized 2023-05-10 16:12:58+00:00 [Note] [Entrypoint]: Starting temporary server 2023-05-10 16:12:58+00:00 [Note] [Entrypoint]: Waiting for server startup 2023-05-10 16:12:58 0 [Note] Starting MariaDB 10.11.2-MariaDB-1:10.11.2+maria~ubu2204 source revision cafba8761af55ae16cc69c9b53a341340a845b36 as process 111 2023-05-10 16:12:58 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2023-05-10 16:12:58 0 [Note] InnoDB: Number of transaction pools: 1 2023-05-10 16:12:58 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions 2023-05-10 16:12:58 0 [Note] InnoDB: Using liburing 2023-05-10 16:12:58 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB 2023-05-10 16:12:58 0 [Note] InnoDB: Completed initialization of buffer pool 2023-05-10 16:12:58 0 [Note] InnoDB: Buffered log writes (block size=512 bytes) 2023-05-10 16:12:58 0 [Note] InnoDB: 128 rollback segments are active. 2023-05-10 16:12:58 0 [Note] InnoDB: Setting file ' ./ibtmp1 ' size to 12.000MiB. Physically writing the file full; Please wait ... 2023-05-10 16:12:58 0 [Note] InnoDB: File ' ./ibtmp1 ' size is now 12.000MiB. 2023-05-10 16:12:58 0 [Note] InnoDB: log sequence number 46590; transaction id 14 2023-05-10 16:12:58 0 [Note] Plugin ' FEEDBACK ' is disabled. 2023-05-10 16:12:58 0 [Warning] ' user ' entry ' root@14890c14c5dc ' ignored in --skip-name-resolve mode. 2023-05-10 16:12:58 0 [Warning] ' proxies_priv ' entry ' @% root@14890c14c5dc ' ignored in --skip-name-resolve mode. 2023-05-10 16:12:58 0 [Note] mariadbd: ready for connections. Version: ' 10 .11.2-MariaDB-1:10.11.2+maria~ubu2204 ' socket: ' /run/mysqld/mysqld.sock ' port: 0 mariadb.org binary distribution 2023-05-10 16:12:59+00:00 [Note] [Entrypoint]: Temporary server started. 2023-05-10 16:13:00+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation) 2023-05-10 16:13:00+00:00 [Note] [Entrypoint]: Stopping temporary server 2023-05-10 16:13:00 0 [Note] mariadbd (initiated by: unknown): Normal shutdown 2023-05-10 16:13:00 0 [Note] InnoDB: FTS optimize thread exiting. 2023-05-10 16:13:00 0 [Note] InnoDB: Starting shutdown... 2023-05-10 16:13:00 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool 2023-05-10 16:13:00 0 [Note] InnoDB: Buffer pool(s) dump completed at 230510 16:13:00 2023-05-10 16:13:00 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1" 2023-05-10 16:13:00 0 [Note] InnoDB: Shutdown completed; log sequence number 46590; transaction id 15 2023-05-10 16:13:00 0 [Note] mariadbd: Shutdown complete 2023-05-10 16:13:00+00:00 [Note] [Entrypoint]: Temporary server stopped 2023-05-10 16:13:00+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up. 2023-05-10 16:13:00 0 [Note] Starting MariaDB 10.11.2-MariaDB-1:10.11.2+maria~ubu2204 source revision cafba8761af55ae16cc69c9b53a341340a845b36 as process 1 2023-05-10 16:13:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2023-05-10 16:13:00 0 [Note] InnoDB: Number of transaction pools: 1 2023-05-10 16:13:00 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions 2023-05-10 16:13:00 0 [Note] InnoDB: Using liburing 2023-05-10 16:13:00 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB 2023-05-10 16:13:00 0 [Note] InnoDB: Completed initialization of buffer pool 2023-05-10 16:13:00 0 [Note] InnoDB: Buffered log writes (block size=512 bytes) 2023-05-10 16:13:00 0 [Note] InnoDB: 128 rollback segments are active. 2023-05-10 16:13:00 0 [Note] InnoDB: Setting file ' ./ibtmp1 ' size to 12.000MiB. Physically writing the file full; Please wait ... 2023-05-10 16:13:00 0 [Note] InnoDB: File ' ./ibtmp1 ' size is now 12.000MiB. 2023-05-10 16:13:00 0 [Note] InnoDB: log sequence number 46590; transaction id 14 2023-05-10 16:13:00 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool 2023-05-10 16:13:00 0 [Note] Plugin ' FEEDBACK ' is disabled. 2023-05-10 16:13:00 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work. 2023-05-10 16:13:00 0 [Note] InnoDB: Buffer pool(s) load completed at 230510 16:13:00 2023-05-10 16:13:00 0 [Note] Server socket created on IP: ' 0 .0.0.0 '. 2023-05-10 16:13:00 0 [Note] Server socket created on IP: ' :: 2023-05-10 16:13:00 0 [Note] mariadbd: ready for connections. Version: ' 10 .11.2-MariaDB-1:10.11.2+maria~ubu2204 ' socket: ' /run/mysqld/mysqld.sock ' port: 3306 mariadb.org binary distribution Poslužitelj zaustavljamo naredbom docker kill : $ docker kill b618846ff70c0012813dc62c02a3e262f29d0ac6e54d4504ff042914e7f6d9e9 Naredba docker ps ukazuje da poslužitelj više nije pokrenut: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES Uvjerili smo se da možemo pokrenuti i zaustaviti poslužitelj, ali klijent se neće moći povezati na ovako pokrenut poslužitelj. Naime, kako bi se mogla ostvariti veza klijenta i poslužitelja, oni moraju biti u istoj mreži i poslužitelj mora biti imenovan. Stvorimo mrežu naredbom docker network : $ docker network create db-network ef5139aa1ec739e9c5da903581328a537380095b9117b555d72a1b33678836b7 Pokrenimo poslužitelj na toj mreži i nazovimo ga fidit-mariadb korištenjem parametra --name : $ docker run --detach --network db-network --name fidit-mariadb --env MARIADB_ROOT_PASSWORD = m0j4z4p0rk4 mariadb:10.11 39b77a3679fd4e5c8638d63d3d577464b46c3ee0b9cc34a965b100355b9bb6aa Pokrenimo klijent na istoj mreži i iskoristimo parametar -h naredbe mariadb za navođenje imena poslužitelja, parametar -u za navođenje imena korisnika i parametar -p za uključivanje upita za zaporkom. Uočimo pritom kako naredba mariadb ne očekuje razmak između parametra i njegove vrijednosti. $ docker run -it --network db-network mariadb:10.11 mariadb -hfidit-mariadb -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g . Your MariaDB connection id is 3 Server version: 10 .11.2-MariaDB-1:10.11.2+maria~ubu2204 mariadb.org binary distribution Copyright ( c ) 2000 , 2018 , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [( none )] > Nakon unošenja zaporke vidimo da smo se uspješno povezali na po...