Databases
This guide provides step-by-step instructions to help users set up databases and manage access directly on virtual machines using console access or SSH tools like PuTTY.
Below is a list of all supported databases along with their compatible operating systems. You can click on each tab to view more details.
MYSQL [Ubuntu 24.04/22.04]
Create User & Database, Then Run Security Script
Step 1: Run the Security Script
sudo mysql_secure_installationYou’ll be prompted to:
Set a root password (if not already set)
Remove anonymous users
Disallow remote root login
Remove the test database
Reload privilege tables
Tip: Press
Yto accept the recommended security settings.
Step 2: Log In to MySQL
With the admin password set, you can now access your MySQL instance by running the following command:
sudo mysql -u root -pUsername:
rootPassword: (enter the password you set in Step 1)
MYSQL [Alma Linux 9.5/ 8.5]
Create User & Database, Then Run Security Script
Run the MySQL Security Script:
sudo mysql_secure_installationYou’ll be prompted to:
Change the root password
Remove anonymous users
Disallow remote root login
Remove the test database
Reload privilege tables
Tip: Press Y to accept the recommended security settings.
Log In to MySQL
mysql -u root -pEnter the root password you set during the security script.
Configure MySQL for Remote Access
sudo nano /etc/my.cnfFind the line with bind-address and change it to:
bind-address = 0.0.0.0Save and exit the file.
Restart MySQL Service
sudo systemctl restart mysqldOpen MySQL Port in Firewall
sudo firewall-cmd --permanent --add-service=mysql
sudo firewall-cmd --reloadVerify MySQL Access
sudo mysql -u root -pUsername: root Password: (your admin password)
PostgreSQL [Ubuntu 24.04]
Create User & Database
sudo -i -u postgres
createuser --interactive
createdb mydatabaseOr via SQL:
psql
CREATE USER myuser WITH PASSWORD 'mypassword';
CREATE DATABASE mydb OWNER myuser;
\qOptional: Enable Remote Access
sudo nano /etc/postgresql/16/main/postgresql.conf
Set:
listen_addresses = '*'
sudo nano /etc/postgresql/16/main/pg_hba.conf
Add:
host all all 0.0.0.0/0 md5
sudo systemctl restart postgresqlMariaDB [Ubuntu24.04/22.04]
Create User & Database, Then Run Security Script
Run the Security Script
sudo mysql_secure_installationYou’ll be prompted to:
Set a root password (if not already set)
Remove anonymous users
Disallow remote root login
Remove the test database
Reload privilege tables
Tip: Press Y to accept the recommended security settings.
Log In to MariaDB
sudo mariadb -u root -pUsername: root Password: (enter the password you set above)
Enable Remote Access (Optional)
sudo nano /etc/my.cnfLocate the bind-address line and update it to:
bind-address = 0.0.0.0Save and exit the file.
Restart MariaDB Service
sudo systemctl restart mysqldOpen MariaDB Port in Firewall
sudo firewall-cmd --permanent --add-service=mysql
sudo firewall-cmd --reloadMongoDB [Ubuntu 24.04/22.04]
In order to start and enable service:
sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl status mongodWith an admin without password you can now access your MongoDB instance, run command.
Launch the MongoDB Shell
mongoshView Available Databases
Once inside the shell, run:
show databases;Expected Output:
admin 40.00 KiB
config 12.00 KiB
local 72.00 KiBExit the MongoDB Shell
Press Ctrl + Z to exit the shell and return to the command prompt.
For secure access to Mongo DB (Optional)
Step 1: Start MongoDB Shell
mongoshStep 2: Switch to admin Database
use adminStep 3: Create an Admin User with Password
Replace YourStrongPassword123! with your own strong password.
db.createUser({
user: "admin",
pwd: "YourStrongPassword123!",
roles: [ { role: "root", db: "admin" } ]
})Step 4: Enable Authentication
Edit the MongoDB config file:
sudo nano /etc/mongod.confFind the section:
#security: Uncomment and enable:
security:authorization: enabled Save and exit (CTRL+O, CTRL+X).
Step 5: Restart MongoDB
sudo systemctl restart mongodStep 6: Log in with Password
Now you must use your username and password:
mongosh -u admin -p YourStrongPassword123! --authenticationDatabase adminMongoDB [Alma Linux 9.5/8.10]
In order to start and enable service:
sudo systemctl enable mongod
sudo systemctl start mongod
sudo systemctl status mongodOpen Firewall (Optional for remote access):
sudo firewall-cmd --zone=public --add-port=27017/tcp --permanent
sudo firewall-cmd –reloadWith an admin without password you can now access your MongoDB instance, run command.
Launch the MongoDB Shell
mongoshView Available Databases
Once inside the shell, run:
show databases;Expected Output:
admin 40.00 KiB
config 12.00 KiB
local 72.00 KiBExit the MongoDB Shell
Press Ctrl + Z to exit the shell and return to the command prompt.
For secure access to Mongo DB (Optional)
Step 1: Start MongoDB Shell
mongoshStep 2: Switch to admin Database
use adminStep 3: Create an Admin User with Password
Replace YourStrongPassword123! with your own strong password.
db.createUser({
user: "admin",
pwd: "YourStrongPassword123!",
roles: [ { role: "root", db: "admin" } ]
})Step 4: Enable Authentication
Edit the MongoDB config file:
sudo nano /etc/mongod.confFind the section:
#security: Uncomment and enable:
security:authorization: enabled Save and exit (CTRL+O, CTRL+X).
Step 5: Restart MongoDB
sudo systemctl restart mongodStep 6: Log in with Password
Now you must use your username and password:
mongosh -u admin -p YourStrongPassword123! --authenticationDatabase adminRedis Server [Ubuntu24.04/22.04] / AlmaLinux 9.5/8.10
You can access your Redis instance using the default admin user without a password. To verify connectivity and run basic commands, please follow the steps below:
Launch the Redis CLI:
redis-cliAt the prompt, test the connection by running:
pingYou should see the response:
PONGTo exit the Redis CLI, simply type: exit
LAMP [Ubuntu24.04/22.04]
Getting Started After Deploying LAMP
LAMP MOTD
On your first SSH login to the VM or launch of the VM console of your PhpMyAdmin VM 1-Click; you will be greeted by a message of the day which includes the admin password for your PhpMyAdmin instance:
LAMP passwords location
If for any reason, you are unable to access the message of the day, you can get the admin password by simply reading the /root/.neoncloud_password file in your VM:
PhpMyAdmin login screen
With an admin password, you can now access your PhpMyAdmin instance, by visiting:
http://<your_server_IP>/phpmyadminUsername → admin Password → StrongPass123!
Last updated
Was this helpful?

