# Database war
Mysql & Mongodb
Installation

Hey my friends, a new post about this war, but with different characters. I don't know which is better, but I'll try to figure it out. I hope y'all enjoy this series. Here we go!

This time I'm going to talk about how install two databases MYSQL and Mongodb


### Mysql

It's important to update the repositories.

```
sudo apt update

```

This command is to install the server

```
sudo apt install mysql-server
```

![Selection_444.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028485550/OeQgysDv6.png)

This command you can check if MYSQL is running

```
sudo systemctl status mysql
```

![Selection_448.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028532432/9shvDknaG.png)

### MongoDB

Maybe you get an outdated version from the repositories, then you can use this command to get the last version.

```
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

```

![Selection_446.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028505468/CYwENbvor.png)

This command is to add and to create a file in this path /etc/apt/sources.list.d

```
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

```

![Selection_447.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028521278/fBWPFZ2tA.png)

It's important to update the repositories.

```
sudo apt update

```

This command is to install the server

```
sudo apt install mongodb-org
```

![Selection_449.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028564888/doM6Zs3b0.png)


The last command doesn't run the daemon, then you need run this command 

```
sudo systemctl start mongod.service
```


This command you can check if MongoDB is running

```
sudo systemctl status mongod
```
![Selection_450.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1614028638429/8Ftkc0XNe.png)

Conclusion

This is our first view about two databases.

- MYSQL is easier to install, but because the MongoDB is outdated in the repositories.

Would you like to see new things about databases?

I hope you enjoy my post and remember that I am just a Dev like you!

