{"id":20003,"date":"2026-11-15T09:51:42","date_gmt":"2026-11-15T07:51:42","guid":{"rendered":"https:\/\/www.beseit.net\/?p=20003"},"modified":"2026-11-15T09:51:45","modified_gmt":"2026-11-15T07:51:45","slug":"crear-bd-llistes-a-servidor-local-amb-user-root-i-password-1234i-connexio-a-dbeave","status":"publish","type":"post","link":"http:\/\/www.beseit.net\/?p=20003","title":{"rendered":"crear BD (llistes) a servidor local amb user root i password 1234i  connexi\u00f3 a dbeave"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">crear BD (llistes) a servidor local amb user root i password 1234i connexi\u00f3 a dbeave<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">servidor<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\ud83d\udccb Resum: Servidor MariaDB local a Deepin + DBeaver<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Guia de refer\u00e8ncia per repetir el proc\u00e9s en qualsevol equip amb Deepin.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 0 \u2014 DBeaver<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ja instal\u00b7lat. Si no ho fos:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install dbeaver-ce   # o descarregar .deb des de dbeaver.io<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 1 \u2014 Instal\u00b7lar MariaDB (servidor + client)<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt update\nsudo apt install mariadb-server mariadb-client<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 2 \u2014 Iniciar i activar el servei (que arrenqui sol)<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl start mariadb\nsudo systemctl enable mariadb\nsudo systemctl status mariadb   # ha de dir \"active (running)\"<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 3 \u2014 Crear la base de dades <code>llistes_YT<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Entra com a root (sense contrasenya, perqu\u00e8 Deepin usa <code>unix_socket<\/code>):<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo mysql<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Dins de MariaDB:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE DATABASE IF NOT EXISTS llistes_YT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 4 \u2014 Crear la taula <code>llistes<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Encara dins de MariaDB:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">USE llistes_YT;\n\nCREATE TABLE IF NOT EXISTS llistes (\n    id          INT AUTO_INCREMENT PRIMARY KEY,\n    nom         VARCHAR(255) NOT NULL,\n    url         VARCHAR(500),\n    canal       VARCHAR(255),\n    categoria   VARCHAR(100),\n    data_lectura DATETIME DEFAULT CURRENT_TIMESTAMP\n);\n\nSHOW TABLES;   -- per confirmar que s'ha creat<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\ud83d\udca1 Ajusta els camps al teu projecte. Aquesta \u00e9s una plantilla raonable per a llistes de v\u00eddeos.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 5 \u2014 Posar contrasenya a <code>root<\/code> (perqu\u00e8 DBeaver hi pugui entrar)<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';\nFLUSH PRIVILEGES;\nEXIT;<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 6 \u2014 Provar la connexi\u00f3 per TCP (el mateix que far\u00e0 DBeaver)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Al terminal normal:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mysql -u root -p -h 127.0.0.1 -P 3306<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Contrasenya: <code>1234<\/code> \u2192 si entra a <code>MariaDB [(none)]&gt;<\/code>, tot b\u00e9. Escriu <code>EXIT;<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Pas 7 \u2014 Configurar DBeaver<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Base de dades \u2192 Nova connexi\u00f3 \u2192 MariaDB<\/strong> i omplir:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Camp<\/th><th>Valor<\/th><\/tr><\/thead><tbody><tr><td>Server Host<\/td><td><code>localhost<\/code><\/td><\/tr><tr><td>Port<\/td><td><code>3306<\/code><\/td><\/tr><tr><td>Database<\/td><td><code>llistes_YT<\/code><\/td><\/tr><tr><td>Username<\/td><td><code>root<\/code><\/td><\/tr><tr><td>Password<\/td><td><code>1234<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Clic a <strong>Probar conexi\u00f3n<\/strong> \u2192 \u2705 <em>Connected<\/em>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udfaf Resultat final<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">DBeaver mostra l&#8217;arbre:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">llistes_YT (localhost:3306)\n\u2514\u2500\u2500 Databases\n    \u251c\u2500\u2500 llistes_YT   \u2190 aqu\u00ed hi ha la teva taula \"llistes\"\n    \u2514\u2500\u2500 sys<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Per executar SQL, obre <strong>SQL \u2192 New SQL Script<\/strong> i prem <strong>Ctrl + Enter<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd01 Comanda r\u00e0pida per repetir-ho tot (script)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Si algun dia ho vols fer d&#8217;un tir\u00f3 en un equip nou:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt install -y mariadb-server mariadb-client\nsudo systemctl enable --now mariadb\nsudo mysql &lt;&lt;'EOF'\nCREATE DATABASE IF NOT EXISTS llistes_YT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nUSE llistes_YT;\nCREATE TABLE IF NOT EXISTS llistes (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    nom VARCHAR(255) NOT NULL,\n    url VARCHAR(500),\n    canal VARCHAR(255),\n    categoria VARCHAR(100),\n    data_lectura DATETIME DEFAULT CURRENT_TIMESTAMP\n);\nALTER USER 'root'@'localhost' IDENTIFIED BY '1234';\nFLUSH PRIVILEGES;\nEOF<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Miquel, ja ho tens tot muntat i funcionant! \ud83d\ude80 Si vols, el seg\u00fcent pas natural seria <strong>importar dades<\/strong> a la taula <code>llistes<\/code> (per exemple des d&#8217;un CSV o des del teu projecte PHP\/STUD del Synology). Digue-m&#8217;ho i t&#8217;ho preparo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>crear BD (llistes) a servidor local amb user root i password 1234i connexi\u00f3 a dbeave servidor \ud83d\udccb Resum: Servidor MariaDB local a Deepin + DBeaver Guia de refer\u00e8ncia per repetir el proc\u00e9s en qualsevol equip amb Deepin. \u2705 Pas 0 &hellip; <a href=\"http:\/\/www.beseit.net\/?p=20003\">Continua llegint <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20003","post","type-post","status-publish","format-standard","hentry","category-bloc-de-notes"],"_links":{"self":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/20003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20003"}],"version-history":[{"count":2,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/20003\/revisions"}],"predecessor-version":[{"id":20008,"href":"http:\/\/www.beseit.net\/index.php?rest_route=\/wp\/v2\/posts\/20003\/revisions\/20008"}],"wp:attachment":[{"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20003"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.beseit.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}