Problem
After you create a database and authorize an account to install ThinkSNS (V4.1.170 Beta), the following error appears when you call the RDS database:
OPERATION need to be executed set by ADMINCause
ApsaraDB RDS for MySQL restricts SUPER/ADMIN privileges for security and stability. The ThinkSNS installer (install.php) contains a CREATE DATABASE IF NOT EXISTS statement at approximately line 542 that requires these elevated privileges, which causes the error.
Solution
Alibaba Cloud reminds you that:
When you perform operations that have risks, such as modifying instances or data, check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
Before you modify the configurations and data of instances including but not limited to ECS and RDS instances, we recommend that you create snapshots or enable RDS log backup.
If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.
Replace the privileged CREATE DATABASE call in the ThinkSNS installation script with mysql_select_db(), which selects an existing database without requiring administrative privileges.
Step 1: Back up the installation file
Create a backup copy of the following file in your ThinkSNS installation package:
ThinkSNS_V4.1.170_Beta_Full\ThinkSNS_V4_Beta_Full\install\install.phpNote: Always back up the file before modifying it.
Step 2: Locate and replace the code
Open install.php and go to approximately line 542. Find the CREATE DATABASE IF NOT EXISTS statement and the error-handling block that follows it. Replace that code block with the following line:
mysql_select_db($db_config['db_name ']);This replaces the original CREATE DATABASE call (which requires ADMIN-level privileges) with mysql_select_db(), which only requires standard database access permissions.
Step 3: Save and retry the installation
Save the modified file and restart the ThinkSNS installation process. The error should no longer appear.
Applies to
ApsaraDB RDS for MySQL
*This article contains information about a third-party product (ThinkSNS). This information is provided for reference only. Alibaba Cloud makes no guarantees regarding the performance or reliability of third-party products.*