It looks like you're trying to connect MATLAB to a local MySQL database using the JDBC driver on macOS Mojave, but you're running into issues like "invalid file or directory" for the .jar and a "no suitable driver found" message.
This usually happens due to either the driver not being properly located or registered, or a misstep in the configuration. You can try the following steps to resolve the problem:
- Make sure the path to the .jar file is correct, and the file exists at that location.
- Use fullfile() instead of string concatenation when forming file paths, to avoid formatting issues especially on macOS.
- Run javaclasspath('-dynamic') to verify that the JDBC .jar was successfully added to MATLAB’s Java classpath.
- Double-check that the MySQL server is running and accessible at localhost:3306, and that login credentials and database name are correct.
Feel free to go through the documentation of methods used:
