MySQL Server administration
Change the MySQL root password, update the configuration file to match, and allow remote connections.
1. Changing the root password
The default MySQL Server root password is 123456. To change it:
Suppose HelpChat Server is installed in the default directory:
text
C:\HelpChat Server\ Open a command prompt and go to the following directory:
bash
cd "C:\HelpChat Server\imserver\mysql\bin" Run the following commands in order:
sql
mysql -u root --port=6306 -p
-- Enter the default password 123456
use mysql;
UPDATE user SET Password=PASSWORD('new_password') WHERE User='root';
FLUSH PRIVILEGES;
EXIT; Info
If the UPDATE command above does not work, use either of the following lines instead:
sql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
-- or
UPDATE user SET authentication_string=password('new_password') WHERE user='root'; After the change, update the password in the following configuration file as well:
config/mysql.ini
C:\HelpChat Server\config\mysql.ini Then restart all background services.
2. Allowing remote users to connect
sql
GRANT ALL PRIVILEGES ON *.* TO 'root'@'IP_address' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES; Edit the configuration file /etc/mysql/my.cnf and add:
ini
bind-address = 0.0.0.0 Warning
Open remote connections only when necessary. Use a strong password and restrict which IP addresses can connect.