Metin2 Navicat Password Change and Database Security
On Metin2 PVP servers, all critical data such as player data, account information and market records are stored in the MySQL/MariaDB database. To protect your server from cyber attacks (brute-force, SQL injection, etc.) and for your game security, the first thing you should do is to change the default Navicat password and ensure database security.
1. Secure Navicat (MySQL) Password Change via Putty
It is the safest and error-free method to change the password directly via Putty (SSH) instead of the Navicat interface. Follow the steps below in order:
- Open the Putty program and connect to your server with your root information.
- To log into the MySQL console, type the following command and press Enter:
mysql -u root -p - If it asks for a password, enter your current Navicat password (The password will not appear on the screen while typing, type it and press Enter).
- After successfully logging in to the console, edit and run the following command line to define your new password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'PvPSunucusuSQL'; - To make the changes take effect on connections coming from an external network, execute the following command:
ALTER USER 'root'@'%' IDENTIFIED BY 'PvPSunucusuSQL'; - Finally, refresh permissions and log out:
FLUSH PRIVILEGES;exit
2. Defining the New Password in Game Files (CONFIG)
After changing the Navicat password, you need to save the new password in your files so that your game channels (CHs) can connect to the database. Otherwise, the server will give a "Connection Refused" error:
- Connect to your server with Filezilla and
/usr/game/cores/Go to directory. - In all channels (channel1, channel2, game99, auth etc.) CONFIG Open the files one by one.
- contained within
PLAYER_SQL_PWD,COMMON_SQL_PWDandLOG_SQL_PWDType the new password you set in front of the fields and save the files. - After the process is completed, send it to the server via Putty.
rebootthrow it away.
3. Golden Rules for Database Security
Changing your password alone may not be enough. For extra security, remember to take these precautions:
- Use Unguessable Passwords: Make sure your password contains uppercase and lowercase letters, numbers and special characters such as (*, -, ?, !).
- Port Change: Change the default MySQL port 3306 to a different port number on FreeBSD to avoid being targeted by cyber attackers.
- Delete Unnecessary Users: in Navicat
mysql.userCheck the table and delete all non-root user accounts, old ones left by the file creators, or unnecessary user accounts opened for testing purposes.
This article is specially prepared for PvPServer.