{"id":2318,"date":"2025-03-15T12:30:00","date_gmt":"2025-03-15T17:30:00","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=2318"},"modified":"2025-01-14T05:52:44","modified_gmt":"2025-01-14T11:52:44","slug":"how-to-install-mysql-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/","title":{"rendered":"How to Install MySQL on Ubuntu 24.04"},"content":{"rendered":"\n<p>In this tutorial, we will explain how to install MySQL on Ubuntu 24.04 OS. MySQL is an open-source relational database management system storing data in table structures under different data types. The data types are integer, string, float, datetime, varchar, etc. Every data type stores various kinds of information. For example, an integer is for numbers, a float is for decimal numbers, the string is intuitive and stores strings, DateTime stores the date in a unique format, and so on. Michael Widenius wrote MySQL in C and C++, and many database-driven web applications, including Drupal, Joomla, WordPress, and Magento, use it extensively. Global applications like Facebook, YouTube, and Twitter use MySQL for their database management needs.<\/p>\n\n\n\n<p>In the following paragraphs, we will install MySQL and provide you with some basic commands. Installing MySQL on Ubuntu 24.04 is a straightforward process that may take up to 10 minutes.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <a href=\"https:\/\/www.linuxcloudvps.com\/cloud-vps.html\" target=\"_blank\" rel=\"noreferrer noopener\">server with Ubuntu 24.04<\/a> as OS<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1. Update the System<\/h2>\n\n\n\n<p>Before we start with the installation of MySQL, we will update the system packages to their latest versions available:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step2. Install MySQL database service<\/h2>\n\n\n\n<p>The latest Ubuntu 24.04 OS includes the MySQL package. To install MySQL, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install mysql-server -y<\/pre>\n\n\n\n<p>Once installed to start and enable the MySQL service for an automatic start after the system reboot, execute the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start mysql &amp;&amp; sudo systemctl enable mysql<\/pre>\n\n\n\n<p>You should get the following lines after starting and enabling the service:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo systemctl start mysql &amp;&amp; sudo systemctl enable mysql\nSynchronizing state of mysql. service with SysV service script with \/usr\/lib\/systemd\/systemd-sysv-install.\nExecuting: \/usr\/lib\/systemd\/systemd-sysv-install enable mysql\n<\/pre>\n\n\n\n<p>To check the status of the service, you can execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl status mysql<\/pre>\n\n\n\n<p>You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo systemctl status mysql\n\u25cf mysql.service - MySQL Community Server\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/mysql.service; enabled; preset: enabled)\n     Active: active (running) since Mon 2025-01-13 17:46:25 CST; 3min 18s ago\n   Main PID: 346842 (mysqld)\n     Status: \"Server is operational\"\n      Tasks: 37 (limit: 4613)\n     Memory: 364.0M (peak: 378.5M)\n        CPU: 3.243s\n     CGroup: \/system.slice\/mysql.service\n             \u2514\u2500346842 \/usr\/sbin\/mysqld\n\nJan 13 17:46:24 host.test.vps systemd[1]: Starting mysql.service - MySQL Community Server...\nJan 13 17:46:25 host.test.vps systemd[1]: Started mysql.service - MySQL Community Server.\n<\/pre>\n\n\n\n<p>To restart the MySQL service, you can use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart mysql<\/pre>\n\n\n\n<p>If you want to stop the MySQL service, you can use the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl stop mysql<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3. Secure MySQL<\/h2>\n\n\n\n<p>To secure the MySQL database server after a fresh installation, set a strong MySQL root password. To do that, execute the following command, which will execute the security script:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mysql_secure_installation<\/pre>\n\n\n\n<p>After this, there will be a couple of questions and steps that you need to complete to secure the MySQL service fully.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Press y|Y for Yes, any other key for No: <strong>Y<\/strong>\n\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: <strong>2<\/strong>\n\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : <strong>Y<\/strong>\n\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : <strong>Y<\/strong>\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : <strong>Y<\/strong>\n\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : <strong>Y<\/strong>\n<\/pre>\n\n\n\n<p>You have now completed and configured everything. In the final section, we will provide you with some basic and most important commands in MySQL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4. MySQL commands<\/h2>\n\n\n\n<p>As mentioned in the first paragraph, installing the MySQL service is a straightforward process. Now we will provide you with some basic MySQL commands for creating a database, creating a user, granting permission, making a dump of a database, and how to import as well.<\/p>\n\n\n\n<p>Check the <strong>MySQL Version<\/strong> with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -V<\/pre>\n\n\n\n<p>You should get output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# mysql -V\nmysql  Ver 8.0.40-0ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))<\/pre>\n\n\n\n<p>Execute the command <strong>mysql<\/strong> in your terminal to log in to the <strong>MySQL console<\/strong>. This action will produce the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# <strong>mysql<\/strong>\nWelcome to the MySQL monitor. Commands end with ; or \\g.\nYour MySQL connection id is 10\nServer version: 8.0.40-0ubuntu0.24.04.1 (Ubuntu)\n\nCopyright (c) 2000, 2024, Oracle and\/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt; \n<\/pre>\n\n\n\n<p>Set the <strong>MySQL Root password<\/strong> and change the authentication method with the following command. This action will require the MySQL console to ask for the root password instead of allowing users to log in without it:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'StrongR00tp@sw0rdHere!';<\/pre>\n\n\n\n<p>Now if you try to login only with <strong>mysql<\/strong> you will get the following message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# mysql\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)\n<\/pre>\n\n\n\n<p>This tells us that the login requires specifying username and password. So, to log in as a root user, you can use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u root -p<\/pre>\n\n\n\n<p>The prompt will ask you to enter the root password you set before:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# mysql -u root -p\nEnter password:\n<\/pre>\n\n\n\n<p><strong>Create a database <\/strong>with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE DATABASE dbtest;<\/pre>\n\n\n\n<p><strong>Create a database user<\/strong> with a strong password using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'Str0ngP@sswordHere!!';<\/pre>\n\n\n\n<p><strong>Grant permissions<\/strong> for the user on the database with the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GRANT ALL ON dbtest.* TO 'dbuser'@'localhost' WITH GRANT OPTION;<\/pre>\n\n\n\n<p><strong>FLUSH PRIVILEGES<\/strong> instructs database to reload the in-memory copy of privileges from the privilege tables.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">FLUSH PRIVILEGES;<\/pre>\n\n\n\n<p>After all these commands, your MySQL console should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; CREATE DATABASE dbtest;\nQuery OK, 1 row affected (0.01 sec)\n\nmysql&gt; CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'Str0ngP@sswordHere!!';\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql&gt; GRANT ALL ON dbtest.* TO 'dbuser'@'localhost' WITH GRANT OPTION;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; FLUSH PRIVILEGES;\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql&gt;\n<\/pre>\n\n\n\n<p>To make a copy of the database, use the <strong>database dump<\/strong> feature. Perform the MySQL dump outside the MySQL console. First, exit the MySQL console:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; exit;\nBye\n<\/pre>\n\n\n\n<p>Once logged out of the MySQL console, to make the MySQL dump execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysqldump -u root -p dbtest &gt; dbtest.sql<\/pre>\n\n\n\n<p><strong>MySQL import<\/strong> is process when you want to restore the database from the backup. Perform the MySQL import outside the MySQL console using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u root -p dbtest &lt; dbtest.sql<\/pre>\n\n\n\n<p>The only difference is the <strong>mysql<\/strong> instead of mysqldump and the sign <strong>&lt; <\/strong>instead of <strong>&gt;<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Congratulations!<\/h2>\n\n\n\n<p>That&#8217;s it. You successfully installed MySQL database service on Ubuntu 24.04 OS.<\/p>\n\n\n\n<p>If you liked this post about how to install MySQL on Ubuntu 24.04, please share it with your friends or leave a comment down below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will explain how to install MySQL on Ubuntu 24.04 OS. MySQL is an open-source relational database management system storing data in table structures under different data types. The data types are integer, string, float, datetime, varchar, etc. Every data type stores various kinds of information. For example, an integer is for &#8230; <a title=\"How to Install MySQL on Ubuntu 24.04\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/\" aria-label=\"More on How to Install MySQL on Ubuntu 24.04\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":2324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[272,332],"tags":[118,168],"class_list":["post-2318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ubuntu-24-04","tag-how-to","tag-how-to-install"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-15T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"How to Install MySQL on Ubuntu 24.04\",\"datePublished\":\"2025-03-15T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/\"},\"wordCount\":714,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/how-to-install-mysql-on-ubuntu-24-04.webp\",\"keywords\":[\"how to\",\"how to install\"],\"articleSection\":[\"Databases\",\"ubuntu 24.04\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/\",\"name\":\"How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/how-to-install-mysql-on-ubuntu-24-04.webp\",\"datePublished\":\"2025-03-15T17:30:00+00:00\",\"description\":\"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/how-to-install-mysql-on-ubuntu-24-04.webp\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/how-to-install-mysql-on-ubuntu-24-04.webp\",\"width\":742,\"height\":410,\"caption\":\"How to Install MySQL on Ubuntu 24.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-mysql-on-ubuntu-24-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install MySQL on Ubuntu 24.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.facebook.com\\\/LinuxCloudVPS\",\"https:\\\/\\\/x.com\\\/LinuxCloudVPS\",\"http:\\\/\\\/www.linkedin.com\\\/company\\\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/www.linuxcloudvps.com\\\/\"],\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog","description":"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog","og_description":"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2025-03-15T17:30:00+00:00","og_image":[{"width":742,"height":410,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"How to Install MySQL on Ubuntu 24.04","datePublished":"2025-03-15T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/"},"wordCount":714,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp","keywords":["how to","how to install"],"articleSection":["Databases","ubuntu 24.04"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/","name":"How to Install MySQL on Ubuntu 24.04 | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp","datePublished":"2025-03-15T17:30:00+00:00","description":"Learn how to Install MySQL on Ubuntu 24.04 using our latest detailed and easy-to-follow step-by-step guide.","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/03\/how-to-install-mysql-on-ubuntu-24-04.webp","width":742,"height":410,"caption":"How to Install MySQL on Ubuntu 24.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-mysql-on-ubuntu-24-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install MySQL on Ubuntu 24.04"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=2318"}],"version-history":[{"count":5,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2318\/revisions"}],"predecessor-version":[{"id":2323,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2318\/revisions\/2323"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/2324"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=2318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=2318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=2318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}