<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Alaa Mkbs</title>
    <description>The latest articles on Forem by Alaa Mkbs (@mkbs_alaa).</description>
    <link>https://forem.com/mkbs_alaa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2519046%2F017c8a64-e732-4309-8153-b33f28799742.jpeg</url>
      <title>Forem: Alaa Mkbs</title>
      <link>https://forem.com/mkbs_alaa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mkbs_alaa"/>
    <language>en</language>
    <item>
      <title>I Was Confused About Merise for Weeks. Here's Everything I Learned</title>
      <dc:creator>Alaa Mkbs</dc:creator>
      <pubDate>Sun, 22 Mar 2026 19:33:29 +0000</pubDate>
      <link>https://forem.com/mkbs_alaa/i-was-confused-about-merise-for-weeks-heres-everything-i-learned-4b9k</link>
      <guid>https://forem.com/mkbs_alaa/i-was-confused-about-merise-for-weeks-heres-everything-i-learned-4b9k</guid>
      <description>&lt;p&gt;When I started learning database design, my teacher kept saying "MCD, MLD, MPD" and I had no idea what any of that meant. I searched in English and found almost nothing. That's when I realized Merise is a French methodology, and most of the internet doesn't talk about it.&lt;/p&gt;

&lt;p&gt;So I learned it the hard way. This is the guide I wish existed when I started.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Merise?
&lt;/h2&gt;

&lt;p&gt;Merise is a French software and database design methodology created in the 1970s-80s. It's widely used in France and French-speaking countries, but almost unknown in the English-speaking world where people use ERD or UML instead.&lt;/p&gt;

&lt;p&gt;The core idea of Merise is that you design your database in &lt;strong&gt;3 levels&lt;/strong&gt;, going from abstract to concrete:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;French Name&lt;/th&gt;
&lt;th&gt;English Equivalent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MCD&lt;/td&gt;
&lt;td&gt;Modèle Conceptuel de Données&lt;/td&gt;
&lt;td&gt;Conceptual Data Model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MLD&lt;/td&gt;
&lt;td&gt;Modèle Logique de Données&lt;/td&gt;
&lt;td&gt;Logical Data Model&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MPD&lt;/td&gt;
&lt;td&gt;Modèle Physique de Données&lt;/td&gt;
&lt;td&gt;Physical Data Model&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Think of it like building a house:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MCD&lt;/strong&gt; = the architect's sketch (ideas, no technical details)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MLD&lt;/strong&gt; = the blueprint (structure, measurements)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MPD&lt;/strong&gt; = the actual construction (specific materials, real tools)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Level 1 MCD (Modèle Conceptuel de Données)
&lt;/h2&gt;

&lt;p&gt;MCD is a graphical representation that describes the data of a system and their relationships in an abstract way. You're not thinking about tables or code yet just &lt;strong&gt;what exists&lt;/strong&gt; and &lt;strong&gt;how things relate&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rectangles&lt;/strong&gt; = Entities (contain attributes describing their properties)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ovals&lt;/strong&gt; = Relationships/associations between entities (connected to entities with lines)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cardinalities&lt;/strong&gt; = Indicate the minimum and maximum number of relations between entities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attributes&lt;/strong&gt; = The properties inside each entity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cardinality the hardest part:
&lt;/h3&gt;

&lt;p&gt;Cardinality answers: "how many of X can be related to Y?"&lt;/p&gt;

&lt;p&gt;The format is &lt;code&gt;min,max&lt;/code&gt; on each side:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;1,1&lt;/code&gt; → exactly one (mandatory, unique)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0,1&lt;/code&gt; → zero or one (optional, max one)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1,N&lt;/code&gt; → at least one, can be many&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0,N&lt;/code&gt; → optional, can be many&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;N,N&lt;/code&gt; → many to many → becomes a junction table in MLD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkzqa760pd6hv4gthix3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqkzqa760pd6hv4gthix3.png" alt="[School] 1,N -( has )- 1,1 [Course]" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1,N&lt;/code&gt; next to School → one school has many courses. &lt;code&gt;1,1&lt;/code&gt; next to Course → one course belongs to exactly one school.&lt;/p&gt;

&lt;h3&gt;
  
  
  The N-N rule:
&lt;/h3&gt;

&lt;p&gt;In MCD, N-N relationships stay as just an oval. You &lt;strong&gt;don't create a table&lt;/strong&gt; for them yet that happens in MLD.&lt;/p&gt;

&lt;h2&gt;
  
  
  Level 2 MLD (Modèle Logique de Données)
&lt;/h2&gt;

&lt;p&gt;MLD is the translation of the MCD into a model adapted to relational databases defining tables, columns, primary keys, foreign keys, and relationships between tables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Structure:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tables&lt;/strong&gt; = Come from entities and associations of the MCD&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Columns&lt;/strong&gt; = Based on the attributes from the MCD&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary Key (PK)&lt;/strong&gt; = One or more unique attributes identifying each row&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Foreign Key (FK)&lt;/strong&gt; = Links one table to another&lt;/li&gt;
&lt;li&gt;No data types yet, no indexes that's MPD&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3 rules for converting MCD → MLD:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1) Many-to-One (N:1):&lt;/strong&gt;&lt;br&gt;
The primary key from the N side becomes a foreign key in the other table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2) Many-to-Many (N:N):&lt;/strong&gt;&lt;br&gt;
A new junction table is created. It contains at minimum two foreign keys pointing to both entities. If the association has its own attributes, they go in this table too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) One-to-One (1:1):&lt;/strong&gt;&lt;br&gt;
The primary key of one entity becomes a foreign key in the other table.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example the N-N becomes a real table:
&lt;/h3&gt;

&lt;p&gt;In MCD you had:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsuh9q1orgj3hzxx9mia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsuh9q1orgj3hzxx9mia.png" alt="[Teacher] 1,N -( assigned to )- 1,N [Class]" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In MLD this becomes 3 tables:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffoiab7t3lg0ev5o20jkh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffoiab7t3lg0ev5o20jkh.png" alt="[Teacher] - [TeacherClass] - [Class]" width="800" height="278"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Teacher (id, name, specialty)
Class (id, name)
TeacherClass (id, teacher_id FK, class_id FK)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;TeacherClass&lt;/code&gt; didn't exist in MCD as a table it was just an oval. Now it's a real table. (we can add some attributes if needed)&lt;/p&gt;

&lt;h2&gt;
  
  
  Level 3 MPD (Modèle Physique de Données)
&lt;/h2&gt;

&lt;p&gt;MPD = MLD + &lt;strong&gt;everything specific to your database engine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data types (&lt;code&gt;VARCHAR(255)&lt;/code&gt;, &lt;code&gt;INT&lt;/code&gt;, &lt;code&gt;TIMESTAMP&lt;/code&gt;, &lt;code&gt;BOOLEAN&lt;/code&gt;…)&lt;/li&gt;
&lt;li&gt;Constraints (&lt;code&gt;NOT NULL&lt;/code&gt;, &lt;code&gt;UNIQUE&lt;/code&gt;, &lt;code&gt;DEFAULT&lt;/code&gt;…)&lt;/li&gt;
&lt;li&gt;Indexes&lt;/li&gt;
&lt;li&gt;Engine-specific options (PostgreSQL vs MySQL vs SQLite)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;MLD says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User (id, email, password, role)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MPD says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="n"&gt;gen_random_uuid&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;role&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="s1"&gt;'STUDENT'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_users_email&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use an ORM like Prisma, your &lt;strong&gt;Prisma schema is your MPD&lt;/strong&gt; because it has types (&lt;code&gt;@db.VarChar(255)&lt;/code&gt;), indexes (&lt;code&gt;@@index&lt;/code&gt;), and database-specific decorators.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Is There No English Documentation?
&lt;/h2&gt;

&lt;p&gt;Honestly, this frustrated me a lot. Every time I searched "MCD MLD database design" in English, I got nothing useful.&lt;/p&gt;

&lt;p&gt;The reason is simple: &lt;strong&gt;Merise is French&lt;/strong&gt;. It was created by French researchers, taught in French schools, and used by French companies. English-speaking developers grew up with ERD (Entity-Relationship Diagrams) and UML, which are different tools that do roughly the same thing.&lt;/p&gt;

&lt;p&gt;It's not that Merise is bad it's actually very structured and clean. It's just that the internet is mostly in English, and English devs never learned it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this helped you, drop a comment. And if you know better Merise resources in English, please share them we need more.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>mcd</category>
      <category>mld</category>
      <category>merise</category>
    </item>
    <item>
      <title>The difference between for...of and for...in loops in JavaScript</title>
      <dc:creator>Alaa Mkbs</dc:creator>
      <pubDate>Thu, 04 Dec 2025 22:59:36 +0000</pubDate>
      <link>https://forem.com/mkbs_alaa/the-difference-between-forof-and-forin-loops-in-javascript-dh5</link>
      <guid>https://forem.com/mkbs_alaa/the-difference-between-forof-and-forin-loops-in-javascript-dh5</guid>
      <description>&lt;p&gt;When working with JavaScript, understanding the difference between for...of and for...in loops is crucial for writing clean, efficient code. While they might look similar, they serve different purposes and work with different data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With Arrays:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;for...of&lt;/code&gt; gives you the actual elements&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;for...in&lt;/code&gt; gives you the indices (as strings)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cherry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Output:&lt;/span&gt;
&lt;span class="c1"&gt;// apple&lt;/span&gt;
&lt;span class="c1"&gt;// banana  &lt;/span&gt;
&lt;span class="c1"&gt;// cherry&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cherry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Output:&lt;/span&gt;
&lt;span class="c1"&gt;// 0&lt;/span&gt;
&lt;span class="c1"&gt;// 1&lt;/span&gt;
&lt;span class="c1"&gt;// 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With Strings:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;for...of&lt;/code&gt; gives you each char in the word&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;for...in&lt;/code&gt; gives you the indices (as strings)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;char&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;char&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// h, e, l, l, o&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 0, 1, 2, 3, 4&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With Objects:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;for ... of doesn't work directly with plain objects (This would throw an error)&lt;/li&gt;
&lt;li&gt;for ... in gives you key value for each element
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;city&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NYC&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// for...in works with objects&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// Output: name John, age 30, city NYC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Reset a Forgotten MariaDB User Password</title>
      <dc:creator>Alaa Mkbs</dc:creator>
      <pubDate>Sat, 14 Dec 2024 15:48:15 +0000</pubDate>
      <link>https://forem.com/mkbs_alaa/how-to-reset-a-forgotten-mariadb-user-password-2lpo</link>
      <guid>https://forem.com/mkbs_alaa/how-to-reset-a-forgotten-mariadb-user-password-2lpo</guid>
      <description>&lt;p&gt;Did you or someone using MariaDB forget the password to an account? Don’t worry! Resetting a MariaDB user password on Linux is super easy. Here’s a quick guide with the commands and step-by-step instructions to help you out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj86t3b172s0948wa2yxe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj86t3b172s0948wa2yxe.png" alt="How to reset user password in MariaDB?" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Change MariaDB password using command line
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open a terminal.&lt;/li&gt;
&lt;li&gt;Stop the currently running MariaDB database.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Restart the database process, but this time use the &lt;code&gt;--skip-grant-tables&lt;/code&gt; option. This lets you connect to the database without needing a password.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysqld_safe --skip-grant-tables --skip-networking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now, open a new terminal.&lt;/li&gt;
&lt;li&gt;Login to MariaDB as root. Don't worry, it won't ask you about the password.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mariadb -u root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the &lt;code&gt;FLUSH PRIVILEGES&lt;/code&gt; command and then change the root password with the command below. Change this &lt;code&gt;NEW_PASSWORD_HERE&lt;/code&gt; to your new password. Past these commands line by line inside MariaDB Monitor.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_PASSWORD_HERE';
exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Close your first terminal.&lt;/li&gt;
&lt;li&gt;Stop the current mysqld process properly, and then restart your MariaDB server. Line by line.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo pkill mysqld 
sudo systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Congratulations! You’ve successfully changed the password. Now, go ahead and test it out!
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mariadb -u root -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>mariadb</category>
      <category>sql</category>
      <category>database</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
