Up to 50% off all plan, limited-time offer. Starting at $2.48.

MySQL

Reliable open-source relational database management system.

Verify Installation

mysql --version

Access MySQL Shell

As root:

mysql -u root -p

Password is securely stored in /root/.cloudzy-creds

Connect to a Specific Database as a User

mysql -u <username> -p -D <database> -h <host> -P <port>
  • -U <username> → Database user
  • -p → Prompt for the user’s password
  • -D <database> → Database name to connect to
  • -h <host> → Hostname of the MySQL server (e.g., localhost)
  • -P <port> → Port (default: 3306)

Common MySQL Commands

  • SHOW DATABASES;: List all databases
  • USE DB_NAME;: Switch to a database
  • SHOW TABLES;: List tables in the database
  • DESCRIBE TABLE_NAME;: Show table structure
  • SELECT * FROM TABLE_NAME;: View table data
  • EXIT;: Quit MySQL shell

Important Files & Directories

  • /root/.cloudzy-creds → Stored database credentials
  • /etc/mysql/ → MySQL configuration files
  • /var/lib/mysql/ → Database data files
  • /var/log/mysql/ → Log files

Service Management

systemctl status mysql
systemctl restart mysql
Currently unavailable.

Application Details