Using a relational database connection, create and execute a non-SELECT SQL statement that deletes a database table. The MySQLNative data source configures a database connection to a MySQL® database.
This example uses a MySQL database version 5.7.22 database and the MySQL Connector/C++ driver version 8.0.15.
Connect to the database using the data source name, user name, and password.
MySQL native interface database connection, specified as a connection
object. Starting in R2024a, it is recommended that you use setSecret
and getSecret
to store and retrieve your credentials for databases that require authentication. For
more details, refer to this
example.
SQL statement, specified as a character vector or string scalar. The SQL statement
can be any valid non-SELECT SQL statement.
The SQL statement can be a stored procedure that does not return any result sets.
For stored procedures that return one or more result sets, use the fetch
function.
For information about the SQL query language, see the SQL Tutorial.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.