Skip to main content

MySQL Installation Guide

This guide provides all the key information and getting-started instructions after a successful MySQL installation via DeploySage-CLI. All content is consistent with the terminal output you saw during the installation process.

Installation Summary

Below is the core configuration information for your MySQL installation. We recommend you keep this information safe, especially the initial password.

ItemValue
Installed VersionMySQL 8.0 (e.g., 8.0.41)
Installation Directory/usr/local/mysql
Data Directory/usr/local/mysqldata
Configuration File/etc/my.cnf
Initial Root PasswordAWS@1024

Usage Guide

Service Management

You can manage the MySQL service using standard systemctl commands:

# Start the service
sudo systemctl start mysqld

# Stop the service
sudo systemctl stop mysqld

# Restart the service
sudo systemctl restart mysqld

# Check the service status
sudo systemctl status mysqld

Connecting to the Database

Use the following command and the initial password to log in to the MySQL command-line client:

mysql -uroot -p'AWS@1024'

Common MySQL Commands

After logging in, you can execute standard SQL commands to manage your databases:

-- Show all databases
SHOW DATABASES;

-- Create a new database
CREATE DATABASE my_new_app;

-- Switch to a specific database
USE my_new_app;

-- Show all tables in the current database
SHOW TABLES;

-- Create a new user and set a password
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'a_strong_password';

-- Grant all privileges on a specific database to the user
GRANT ALL PRIVILEGES ON my_new_app.* TO 'newuser'@'localhost';

Important Notes

warning
  1. Your initial MySQL root password has been automatically saved in the /root/readme file on the server for your reference.
  2. For security reasons, this installer only allows connections from the local machine (localhost) by default. If you need to enable remote access, please modify the configuration file /etc/my.cnf (remove or comment out the bind-address line) and ensure you have created a corresponding user and granted permissions for the remote host or IP address.