0% found this document useful (0 votes)
8 views2 pages

Remote Connections in MySQL DBMS

This document provides a step-by-step guide for enabling remote connections to MySQL on a XAMPP server. Key steps include changing the MySQL configuration to allow remote access, adjusting Windows Firewall settings, creating a MySQL user for remote access, and restarting XAMPP. Finally, it outlines how to connect to MySQL from another computer and troubleshoot potential connection issues.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Remote Connections in MySQL DBMS

This document provides a step-by-step guide for enabling remote connections to MySQL on a XAMPP server. Key steps include changing the MySQL configuration to allow remote access, adjusting Windows Firewall settings, creating a MySQL user for remote access, and restarting XAMPP. Finally, it outlines how to connect to MySQL from another computer and troubleshoot potential connection issues.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Remote Connections in MySQL DBMS

To allow MySQL on your XAMPP server to be accessed from another computer, you need to
adjust some configurations to ensure that MySQL is listening on the right network interface and
is not restricting remote connections. Here's a step-by-step guide:

1. Allow Remote Connections in MySQL Configuration

1. Open the XAMPP control panel and click on Config next to MySQL.
2. Select my.ini to open the MySQL configuration file.
3. Find the following line:
4. bind-address = 127.0.0.1

This line restricts MySQL to accept connections only from localhost (your own
computer). Change it to:

bind-address = 0.0.0.0

This will make MySQL accept connections from any IP address.

5. Save and close the file.

2. Allow Access to MySQL in Windows Firewall

If you're using a Windows operating system, you'll need to make sure that your firewall allows
connections to MySQL:

1. Go to Control Panel > System and Security > Windows Defender Firewall.
2. Click on Advanced Settings.
3. In the left pane, select Inbound Rules.
4. Click New Rule in the right pane.
5. Choose Port, then click Next.
6. Select TCP and enter the port 3306 (the default MySQL port).
7. Allow the connection and apply the rule for Domain, Private, and Public profiles.
8. Give the rule a name (e.g., MySQL Access), then finish.

3. Create a MySQL User for Remote Access

You need to grant a user permission to connect from another computer:

1. Open phpMyAdmin (or MySQL CLI).


2. Log in with your root account or any other MySQL admin account.
3. To allow a user to connect from any IP, run this command in SQL (replacing username
with the desired username and password with the password you want to set):
4. CREATE USER 'username'@'%' IDENTIFIED BY 'password';
The % symbol allows the user to connect from any IP address.

5. Grant the user the necessary privileges on the database (replace dbname with the database
name):
6. GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'%';
7. FLUSH PRIVILEGES;

4. Restart XAMPP

Restart both Apache and MySQL from the XAMPP control panel to apply the changes.

5. Access MySQL from Another Computer

1. From the remote computer, use a MySQL client (such as MySQL Workbench,
PHPMyAdmin, or the command line) to connect.
2. Enter the IP address of the machine where XAMPP is running, the username, and the
password you set up earlier.
o Example connection string:
o mysql -h [Your_XAMPP_IP] -u username -p
o Replace [Your_XAMPP_IP] with the actual IP address of the server running
XAMPP.

6. Test the Connection

Once these settings are configured, try connecting from the other computer. If everything is set
up correctly, you should be able to access MySQL from the remote machine.

If you're still having trouble, make sure:

 The remote computer can ping your XAMPP server machine (check for network issues).
 Ensure no other firewalls (e.g., router or third-party firewall software) are blocking the
connection.

You might also like