Installing MySQL 8.0 on Tencent Cloud Lighthouse Server Running CentOS

Setting Up Your Tencent Cloud Account

Before proceeding, ensure you have an active Tencent Cloud account. If you are new to the platform, complete the registration process first. Existing users can simply sign in to their dashboards.

Account Verification

After registration, you must complete real-name authentication as required by Chinese cloud service regulations. Access the authentication portal through your account settings and follow the on-screen instructions to submit the necessary identification documents.

Creating Your Lighthouse Instance

Navigate to the Tencent Cloud Lighthouse product page and select an appropriate pricing plan. Consider your application requirements when choosing specifications. For this demonstration, we selected a 2-core 2GB instance running the Node.js镜像.

After completing the purchase, access your Lighthouse management console and reset the instance password to secure administrative access.

MySQL 8.0 Installation Process

The following steps outline the complete MySQL installation procedure on CentOS.

Step 1: Download the MySQL Repository Package

Obtain the official MySQL yum repository configuration file from the MySQL developer network:

wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

Step 2: Install the Repository Configuration

Add the repository to your system's package manager using the RPM package installer:

sudo rpm -ivh mysql80-community-release-el7-1.noarch.rpm

Step 3: Install MySQL Server

Proceed with the MySQL server installation:

sudo yum install mysql-server -y

Confirm any prompts to proceed with the installation.

Step 4: Verify the Installation

After installation completes, confirm the installed MySQL version:

mysql --version

Step 5: Start and Access MySQL

Initialize the MySQL service and connect to the database server:

sudo systemctl start mysqld
mysql -u root -p

On first access, leave the password field empty and press Enter to proceed. The initial authentication bypasses password verification.

Step 6: Configure the Root Password

Once connected, update the root account with a secure password:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourSecurePassword2024!';

Replace YourSecurePassword2024! with your chosen password. Note that MySQL 8.0 enforces strong password policies.

Step 7: Enable Remote Authentication

To allow external applications to connect to your database, grant remote access permissions:

SHOW DATABASES;
USE mysql;
UPDATE user SET host='%' WHERE user='root';
FLUSH PRIVILEGES;

The host value '%' permits connections from any IP address. For production environments, restrict this to specific trusted IP ranges.

Connecting via Database Client

You can now connect to your MySQL instance using database management tools like Navicat, DBeaver, or MySQL Workbench. Use the following connection parameters:

  • Host: Your server's public IP address
  • Port: 3306 (default)
  • Username: root
  • Password: The password configured in Step 6

Firewall Configuration

If connection attempts fail, verify that your Tencent Cloud security group permits inbound traffic on port 3306. Access the Cloud Firewall settings in your Tencent Cloud console and add an inbound rule allowing TCP traffic on this port.

CentOS 8.x Compatibility Note

The installation steps described above are fully compatible with CentOS 8.2 and later versions. The MySQL repository configuration and installation commands remain identical across these releases.

Tags: MySQL centos tcencent-cloud Linux database

Posted on Tue, 19 May 2026 23:27:22 +0000 by dandaman2007