MySQL: Connect From an Other System / Computer
To connect to a MySQL database from a remote system or computer, you'll need to perform the following steps:
- Ensure that the remote system has access to the database server: The database server must be configured to allow connections from the remote system. The server's firewall and security rules must also be configured to allow connections from the remote system.
- Obtain the necessary connection information: You'll need the database server's hostname or IP address, port number, and the credentials for a user with sufficient privileges to access the database.
- Connect using the MySQL client: You can use the MySQL client command line tool to connect to the database. On the remote system, open a terminal window and enter the following command, replacing the placeholders with your specific connection information:
mysql -u -p -h -P
- Enter the password for the user when prompted: The password is not displayed as you type it.
- Once connected, you can issue SQL commands to the database.
