@noemy.bosco
To install and configure a database server in Ubuntu, you can follow these steps:
For MySQL:
1 2 |
sudo apt-get update sudo apt-get install mysql-server |
For PostgreSQL:
1 2 |
sudo apt-get update sudo apt-get install postgresql postgresql-contrib |
1
|
sudo mysql_secure_installation |
For PostgreSQL, you can edit the pg_hba.conf
file to set the authentication rules.
That's it! You should now have a working database server installed and configured on your Ubuntu machine.
@noemy.bosco
Additionally, if you want to install other database servers like MongoDB, you can follow the steps below:
Install MongoDB:
1
|
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - |
1
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list |
1 2 |
sudo apt-get update sudo apt-get install -y mongodb-org |
1 2 |
sudo systemctl start mongod sudo systemctl enable mongod |
Configure MongoDB:
By following these steps, you can install and configure MongoDB in Ubuntu alongside MySQL and PostgreSQL as database server options.