1- How to install the MYSQL database on Linux operating systems
2- How to create a new database and table in MYSQL database
3- How to CRUD operations with .net core
OS: Jetpack 4.5 ( L4T - 32.5)
Language: C# / MYSQL
In this article, we will show you how to do CRUD operations in MYSQL database with .net core on ARM64 which has an operating system as Ubuntu 18.04 for NVIDIA Jetson Nano/Xavier NX/NX2 TX Modules.
For this application, we will use our carrier board Forecr DSBOARD-NX2 with NVIDIA Jetson Nano module. You can find detailed information about DSBOARD-NX2 from the link below.
Also, we will use MYSQL Database. MYSQL database is an open-source database management system. It is a very popular as a database and it performs fast in Linux Ubuntu 18.04. You can easily download the database to your computers.
The first thing we need to do before starting our application is to install our database. To do this, open terminal and type the following commands:
After the installation of MYSQL database successfully, then type “Mysql --version”. With that command, we can see which version we have installed, and verify MYSQL database installed.
Now, we have already finished the installation process and done with the verification, Let's enter the MYSQL database from the terminal and create a test database. Type the following command, log into MySQL database and type the password that you set up you set up in the installation process.
Then, log into MYSQL database. We will create a sample database called "TestDB". Create the database with the following command:
We will switch to the database with the following command:
Now, we can create a sample table with this database. The table creation with the following command:
Our database is ready and now we can make a connection with CRUD operations from our application to the database.
After, we have finished the database creation process, let’s create a sample C# CRUD operations application using a VS Code. We need to create a new console app with the following command:
Let’s open the application with the VS Code. Then, type the following command:
Connection string is used by the data provider to establish a connection to the database. We specify the host name, username, password, and a database name.
As seen in the main method for connecting to the database, we do our select, insert, and update method.
These are the SQL select, insert, update, deleted statements:
We print the data that was returned by the SQL statement to the terminal. This is the output:
Finally, we executed deleted methods and delete data from the database.
Thank you for reading our blog post.