{"id":25186,"date":"2024-02-26T10:14:47","date_gmt":"2024-02-26T10:14:47","guid":{"rendered":"https:\/\/linuxways.net\/?p=25186"},"modified":"2024-02-26T10:14:47","modified_gmt":"2024-02-26T10:14:47","slug":"install-mysql-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/install-mysql-debian-12\/","title":{"rendered":"How to Install MySQL on Debian 12"},"content":{"rendered":"<p><strong>MySQL <\/strong>is a renowned RDBMS (Relational Database Management System) that is freely available for handling and storing structured data. It is designed to handle massive amounts of data, high traffic, and large-scale applications efficiently and securely. It is extensively used by millions of users including organizations, businesses, and companies because of its reliability and compatibility.<\/p>\n<p><strong>MySQL <\/strong>is available on multiple platforms, such as Windows, and macOS as well as various Linux distributions including Debian. This guide will explain the step-by-step procedure for installing and using <strong>MySQL <\/strong>on Debian 12.<\/p>\n<p><strong>Overview <\/strong><\/p>\n<ul>\n<li><a href=\"#post-25186-_b6185f4uff7x\"><strong>How to Install MySQL on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25186-_6gfbmiode9o8\"><strong>How to Enable MySQL Service on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25186-_7rn7taomwvl3\"><strong>How to Use MySQL on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25186-_6bssq0dkhayh\"><strong>How to Secure the MySQL Server on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25186-_rbw8m662vjej\"><strong>How to Uninstall\/Remove MySQL From Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-25186-_ib4att8y8uty\"><strong>Final Thoughts <\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25186-_b6185f4uff7x\"><\/a>How to Install MySQL on Debian 12<\/h2>\n<p>By default, the <strong>MySQL <\/strong>package is not available on the standard Debian repository. Therefore, to install <strong>MySQL\u2019s <\/strong>latest version on the Debian 12 system, you can download the Debian file of <strong>MySQL <\/strong>APT repository from the MySQL official website.<\/p>\n<p>Follow the given steps to get the latest version of <strong>MySQL <\/strong>on your Debian 12 systems.<\/p>\n<h3><a id=\"post-25186-_neuzoj1l0ehg\"><\/a>Step 1: Update Debian System<\/h3>\n<p>First, refresh the system&#8217;s packages list before installing any new package:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<br \/>\n<span class=\"kw2\">sudo<\/span> apt upgrade<\/div><\/div>\n<p>By doing so, all the packages of the Debian system will be updated.<\/p>\n<h3><a id=\"post-25186-_zhv7vbvwn1dz\"><\/a>Step 2: Download and Add MySQL Repository<\/h3>\n<p>Then, download the latest deb package file of the <strong>MySQL <\/strong>repository on the Debian 12 system through the provided command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">wget<\/span> https:<span class=\"sy0\">\/\/<\/span>dev.mysql.com<span class=\"sy0\">\/<\/span>get<span class=\"sy0\">\/<\/span>mysql-apt-config_0.8.29-<span class=\"nu0\">1<\/span>_all.deb<\/div><\/div>\n<p><strong>Note:<\/strong> Please visit this <a href=\"https:\/\/repo.mysql.com\/\">link<\/a> and download the latest version of the MySQL repository deb file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"528\" class=\"wp-image-25191\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-1.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-1-300x216.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>Alternatively, you can visit the <a href=\"https:\/\/dev.mysql.com\/downloads\/repo\/apt\/\">MySQL official website<\/a> and download the deb file of the <strong>MySQL <\/strong>APT repository directly from there by clicking on the \u201c<strong>Download<\/strong>\u201d button:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"762\" height=\"508\" class=\"wp-image-25193\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-2.png 762w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-2-300x200.png 300w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p>Next, install the <strong>MySQL <\/strong>repository deb file to add it to your Debian system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> .<span class=\"sy0\">\/<\/span>mysql-apt-config_0.8.29-<span class=\"nu0\">1<\/span>_all.deb<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"357\" class=\"wp-image-25197\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-3.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-3-300x146.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>After executing the above command, a pop-up window will appear where you must select some options. Choose the \u201c<strong>MySQL Server &amp; Cluster<\/strong>\u201d option and hit the \u201c<strong>enter<\/strong>\u201d key:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"512\" class=\"wp-image-25201\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-4.png 732w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-4-300x210.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/p>\n<p>Select the \u201c<strong>mysql-8.0<\/strong>\u201d option and press the \u201c<strong>enter<\/strong>\u201d key:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"509\" class=\"wp-image-25208\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-5.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-5-300x207.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>Choose the \u201c<strong>OK<\/strong>\u201d option and hit \u201c<strong>enter<\/strong>\u201d:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"519\" class=\"wp-image-25212\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-6.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-6-300x212.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>Next, update the packages list to implement new changes:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"258\" class=\"wp-image-25217\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-7.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-7-300x105.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h3><a id=\"post-25186-_u3nj6oynqzt6\"><\/a>Step 3: Install MySQL Server<\/h3>\n<p>Now, install the <strong>MySQL <\/strong>server\u2019s latest package on your Debian system via the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> mysql-server<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"467\" class=\"wp-image-25223\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-8.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-8-300x190.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>You will be asked to set a new root password for the MySQL server throughout the installation process. Set the password and hit the \u201c<strong>enter<\/strong>\u201d key:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"485\" class=\"wp-image-25228\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-9.png 734w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-9-300x198.png 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/p>\n<p>Choose \u201c<strong>OK<\/strong>\u201d using the arrow keys:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"536\" class=\"wp-image-25234\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-10.png 732w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-10-300x220.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/p>\n<p>Select the \u201c<strong>Use Strong Password Encryption<\/strong>\u201d option:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"469\" class=\"wp-image-25238\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-11.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-11-300x191.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>Subsequently, the installation will be completed:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"403\" class=\"wp-image-25244\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-12.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-12-300x164.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25186-_vrspawqcq2n3\"><\/a>Step 4: Verify Installation<\/h3>\n<p>To ensure that <strong>MySQL <\/strong>is successfully installed on the Debian system, check its version:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">mysql <span class=\"re5\">--version<\/span><\/div><\/div>\n<p>The below output shows the installed version of <strong>MySQL<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"114\" class=\"wp-image-25248\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-13.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-13-300x46.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h2><a id=\"post-25186-_6gfbmiode9o8\"><\/a>How to Enable MySQL Service on Debian 12<\/h2>\n<p>By default, the <strong>MySQL <\/strong>service starts automatically after the installation is completed. However, if <strong>MySQL <\/strong>service is not running on the system, you can enable it to start automatically during system reboot\/restart using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl <span class=\"kw3\">enable<\/span> mysql<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"92\" class=\"wp-image-25250\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-14.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-14-300x37.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>To verify whether the <strong>MySQL <\/strong>service is running on the Debian system or not, check its status:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> systemctl status mysql<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"389\" class=\"wp-image-25254\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-15.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-15-300x158.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h2><a id=\"post-25186-_6bssq0dkhayh\"><\/a>How to Secure the MySQL Server on Debian 12<\/h2>\n<p>You may want to enhance the security of the <strong>MYSQL <\/strong>database server for several reasons, such as to protect their data from unauthorized access, ensure data integrity, etc. To secure your MySQL database server, you can use the \u201c<strong>sudo mysql_secure_installation<\/strong>\u201d command. This command will provide a detailed instruction to secure your <strong>MySQL <\/strong>installation:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> mysql_secure_installation<\/div><\/div>\n<p>By doing so, it will ask you for various configurations i.e. to remove unknown users, set a new root password, and many more. You can choose the desired options and make changes:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"529\" class=\"wp-image-25256\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-16.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-16-300x216.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"497\" class=\"wp-image-25257\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-17.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-17-300x203.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"486\" class=\"wp-image-25259\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-18.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-18-300x198.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<h2><a id=\"post-25186-_7rn7taomwvl3\"><\/a>How to Use MySQL on Debian 12<\/h2>\n<p>You can use <strong>MySQL <\/strong>on Debian 12 by connecting to the <strong>MySQL <\/strong>server and accessing the <strong>MySQL <\/strong>shell as a root. After that, you will be able to create, view, and use databases, manage tables, and perform various database operations. Follow the provided steps to use MySQL on Debian 12:<\/p>\n<h3><a id=\"post-25186-_c53z8d8tnzg\"><\/a>Access MySQL Database Server<\/h3>\n<p>To access the <strong>MySQL <\/strong>database server, log in to <strong>MySQL <\/strong>shell by executing the given command and providing the root password:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">mysql <span class=\"re5\">-u<\/span> root <span class=\"re5\">-p<\/span><\/div><\/div>\n<p>In the below screenshot, you can see that <strong>MySQL <\/strong>shell has been started:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"383\" class=\"wp-image-25262\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-19.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-19-300x156.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25186-_4bnszbzpw2h\"><\/a>Create MySQL Database<\/h3>\n<p>To create\/make a new MySQL database, use the \u201c<strong>CREATE DATABASE &lt;database-name&gt;<\/strong>\u201d command and specify the database\u2019s name. Here, we are making a database named \u201c<strong>LinuxWaysDB<\/strong>\u201d:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">CREATE DATABASE LinuxWaysDB;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"135\" class=\"wp-image-25263\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-20.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-20-300x55.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h3><a id=\"post-25186-_muevd4yypxbb\"><\/a>Display All MySQL Databases<\/h3>\n<p>If you want to list all the available databases in the MySQL server, type out the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">SHOW DATABASES;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"323\" class=\"wp-image-25264\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-21.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-21-300x132.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<h3><a id=\"post-25186-_oh0vniepe1qb\"><\/a>Switch to a Specific Database<\/h3>\n<p>If you want to use a specific database, you have to switch to it by utilizing the \u201c<strong>USE &lt;database-name&gt;<\/strong>\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">USE LinuxWaysDB;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"114\" class=\"wp-image-25265\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-22.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-22-300x46.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h3><a id=\"post-25186-_2ousv7bu6tna\"><\/a>Create MySQL Table<\/h3>\n<p>To create a <strong>MySQL <\/strong>table in the database, utilize the \u201c<strong>CREATE TABLE<\/strong>\u201d command and specify the desired table name along with the required columns and datatypes. Here, we are creating a \u201c<strong>TechWriter<\/strong>\u201d table with the following columns:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">CREATE TABLE TechWriter<span class=\"br0\">&#40;<\/span>T_ID INT, T_Name VARCHAR<span class=\"br0\">&#40;<\/span><span class=\"nu0\">20<\/span><span class=\"br0\">&#41;<\/span>, Category VARCHAR<span class=\"br0\">&#40;<\/span><span class=\"nu0\">20<\/span><span class=\"br0\">&#41;<\/span>, Experience VARCHAR<span class=\"br0\">&#40;<\/span><span class=\"nu0\">20<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span>;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"157\" class=\"wp-image-25266\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-23.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-23-300x64.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h3><a id=\"post-25186-_mww35i16o9f\"><\/a>Insert Data in MySQL Table<\/h3>\n<p>You can insert values into the <strong>MySQL <\/strong>table using the \u201c<strong>INSERT INTO &lt;table-name&gt; VALUE<\/strong>\u201d command and specify the desired values as seen below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">INSERT INTO TechWriter VALUE <span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;1&quot;<\/span>, <span class=\"st0\">&quot;Jack&quot;<\/span>, <span class=\"st0\">&quot;Linux&quot;<\/span>, <span class=\"st0\">&quot;2 years&quot;<\/span><span class=\"br0\">&#41;<\/span>;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"131\" class=\"wp-image-25267\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-24.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-24-300x53.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25186-_qt5tsl7oeuom\"><\/a>Select Data From Table<\/h3>\n<p>If you want to select and display a specific or all the data from a particular table, the \u201c<strong>SELECT<\/strong>\u201d command is used. For example, we are reading all the data of the \u201c<strong>TechWriter<\/strong>\u201d table using the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">SELECT <span class=\"sy0\">*<\/span> FROM TechWriter;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"281\" class=\"wp-image-25270\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-25.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-25-300x114.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<h3><a id=\"post-25186-_gok6h3imyhf2\"><\/a>Delete MySQL Table Data<\/h3>\n<p>You can also delete a particular record of the specific table using the \u201c<strong>DELETE<\/strong>\u201d command and specifying the required condition. For instance, we are deleting the record of the \u201c<strong>TechWriter<\/strong>\u201d table where the \u201c<strong>T_ID<\/strong>\u201d is \u201c<strong>7<\/strong>\u201d:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">DELETE from TechWriter WHERE <span class=\"re2\">T_Id<\/span>=<span class=\"nu0\">7<\/span>;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"340\" class=\"wp-image-25272\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-26.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-26.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-26-300x139.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25186-_ocxdyx4r7bd7\"><\/a>Delete MySQL Database<\/h3>\n<p>To delete a specific <strong>MySQL <\/strong>database, you can use the \u201c<strong>DROP DATABASE<\/strong>\u201d command along with the database name that needs to be deleted:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">DROP DATABASE LinuxWaysDB;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"128\" class=\"wp-image-25273\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-27.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-27.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-27-300x52.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<h3><a id=\"post-25186-_o9vhztgwzt9l\"><\/a>Leave MySQL Shell<\/h3>\n<p>If you want to leave the <strong>MySQL <\/strong>Shell, type out the below-listed command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">exit<\/span><\/div><\/div>\n<h2><a id=\"post-25186-_4ztsmcctdssb\"><\/a><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"114\" class=\"wp-image-25274\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-28.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-28.png 704w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-28-300x49.png 300w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/h2>\n<h2><a id=\"post-25186-_rbw8m662vjej\"><\/a>How to Uninstall\/Remove MySQL From Debian 12<\/h2>\n<p>In case you do not want to use MySQL on your Debian 12 system, you can simply remove it through the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove mysql-server<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"363\" class=\"wp-image-25276\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-29.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-29.png 702w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25186-29-300x155.png 300w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/p>\n<p>That was all about installing, using, and uninstalling MySQL on Debian 12 systems.<\/p>\n<h2><a id=\"post-25186-_ib4att8y8uty\"><\/a>Final Thoughts<\/h2>\n<p>You can install <strong>MySQL\u2019s <\/strong>latest version on Debian 12 by downloading the Debian file of <strong>MySQL <\/strong>APT repository from the <a href=\"https:\/\/dev.mysql.com\/downloads\/repo\/apt\/\"><strong>MySQL <\/strong>official website<\/a>. This configuration package allows you to choose the <strong>MySQL <\/strong>product and server version that you want to install, and it installs packages directly from the official <strong>MySQL <\/strong>repository. Moreover, this method also updates <strong>MySQL <\/strong>to the new version with the system updates whenever its new release is introduced. This guide has thoroughly explained the ways to install, use, and uninstall <strong>MySQL <\/strong>on Debian 12.<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>You can install MySQL\u2019s latest version on Debian 12 by downloading the Debian file of MySQL APT repository from the MySQL official website.<\/p>","protected":false},"author":112,"featured_media":25307,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-25186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-mint"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25186"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25186\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25307"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}