meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| applications:connect_matlab_mac [2022/05/26 21:22] – gregbalco | applications:connect_matlab_mac [2022/05/26 22:24] (current) – gregbalco | ||
|---|---|---|---|
| Line 30: | Line 30: | ||
| What this does is connect port 3306 (the default MySQL port) on the remote MySQL server, through the SSH tunnel host, to localhost port 12345 on the local machine. Thus, it will appear to a database client (such as MATLAB in this case) that the database is located at localhost: | What this does is connect port 3306 (the default MySQL port) on the remote MySQL server, through the SSH tunnel host, to localhost port 12345 on the local machine. Thus, it will appear to a database client (such as MATLAB in this case) that the database is located at localhost: | ||
| + | |||
| + | The port number 12345 is (obviously) arbitrary. You can use anything that is not already in use on your machine. If a port is in use, your computer will behave oddly. Mostly, high-numbered (5 digits) ports are OK. | ||
| Note that this won't work as I have written it here because the SSH host and database IP address don't exist. You'll need to put in the correct values. If you have already been using a different MySQL client, you know what these are. If not, ask Greg or Joe. | Note that this won't work as I have written it here because the SSH host and database IP address don't exist. You'll need to put in the correct values. If you have already been using a different MySQL client, you know what these are. If not, ask Greg or Joe. | ||
| - | One additional item of importance is that when you are done with this, you will have to shut down the SSH process that is keeping the tunnel open. If you don't, it will eventually die next time your computer goes to sleep, but it is bad practice to leave zombie processes all over the place. | + | One additional item of importance is that when you are done with this, you will have to shut down the SSH process that is keeping the tunnel open. If you don't, it will eventually die next time your computer goes to sleep, but it is bad practice to leave zombie processes all over the place. |
| '' | '' | ||
| Line 52: | Line 54: | ||
| == Connecting MATLAB to the database through the SSH tunnel == | == Connecting MATLAB to the database through the SSH tunnel == | ||
| - | Now that you have an ssh tunnel open to the database, you need to point MATLAB to it. On current MATLAB, it appears the easiest way to do this is to use the 'JDBC data source configuration' | + | Now that you have an ssh tunnel open to the database, you need to point MATLAB to it. On current MATLAB, it appears the easiest way to do this is to use the 'JDBC data source configuration' |
| {{: | {{: | ||
| Line 64: | Line 66: | ||
| '' | '' | ||
| - | This should return a bunch of information about the database connection. You now have a live connection to the database that can be accessed | + | This should return a bunch of information about the database connection. You now have a live connection to the database that can be accessed |
| '' | '' | ||
| Line 87: | Line 89: | ||
| '' | '' | ||
| + | |||
| + | If everything is working as intended, the ' | ||
| To learn more about this, look at the MATLAB documentation for the commands ' | To learn more about this, look at the MATLAB documentation for the commands ' | ||