-
Install MySQL:
sudo apt install mysql-server
(Ubuntu) oryum install mariadb-server
(CentOS) -
Start service:
systemctl start mysql
orsystemctl start mariadb
-
Run secure script:
mysql_secure_installation
-
Create user and database:
CREATE DATABASE mydb; CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost'; FLUSH PRIVILEGES;
-
Configure remote access if needed and use a firewall to limit access.
Most Popular Articles
How to Install and Configure a LAMP Stack on Your Linux VPS
For CentOS/Ubuntu: Run: sudo apt install apache2 mysql-server php php-mysql (Ubuntu) or yum...
How to Set Up Email Services on Your VPS
Install Postfix (Linux) or MailEnable (Windows). Set DNS records (MX, SPF, DKIM, DMARC)....
How to Schedule Automatic Backups on Your VPS
Use rsync and cron jobs.
How to Install and Configure cPanel on Your Linux VPS
Ensure your VPS is running a supported OS (CentOS, AlmaLinux, RockyLinux). Run: yum...
How to Harden SSH Security on Your Linux VPS
Edit the SSH config file: nano /etc/ssh/sshd_config Change the default port from 22 to...