{"id":26239,"date":"2023-02-22T15:27:58","date_gmt":"2023-02-22T15:27:58","guid":{"rendered":"http:\/\/localhost\/helpold\/?p=26239"},"modified":"2025-01-02T13:26:46","modified_gmt":"2025-01-02T09:56:46","slug":"mysql-ubuntu","status":"publish","type":"post","link":"https:\/\/www.arvancloud.ir\/help\/en\/mysql-ubuntu\/","title":{"rendered":"How to Install MySQL in Ubuntu?"},"content":{"rendered":"<p>MySQL is among the most useful open-source database management systems with SQL, which is developed and supported by Oracle. Generally, MySQL is employed for accessing and modifying database information at all levels in database-related work, ranging from the information in a shopping list to the information of the users of a social network. In this guide, we are going to discuss how to install MySQL in Ubuntu 18.04 distribution.<\/p>\n<h2>Create and Connect to an Ubuntu Instance<\/h2>\n<p>The instructions below will help you to create and connect to an instance based on the Ubuntu distribution:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.arvancloud.ir\/en\/cloud-server\/\" rel=\"nofollow noopener\" target=\"_blank\">Getting started with ArvanCloud Server<\/a><\/li>\n<li><a href=\"https:\/\/docs.arvancloud.ir\/en\/cloud-server\/instance\/connection\/\" rel=\"nofollow noopener\" target=\"_blank\">SSH access to the instance<\/a><\/li>\n<\/ul>\n<h2>Installing MySQL on Ubuntu 18.04 LTS<\/h2>\n<p>Having created and connected to an instance based on the Ubuntu distribution, the apt-get must be updated to the latest version for installing MySQL. For this purpose, you can use the following command.<\/p>\n<pre><code class=\"http\">sudo apt-get update<\/code><\/pre>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-25809 aligncenter\" src=\"https:\/\/www.arvancloud.ir\/help\/wp-content\/uploads\/2023\/02\/-\u0646\u0635\u0628-MySQL-\u062f\u0631-Ubuntu-5990302590108_1-1-jpeg.webp\" alt=\"\" width=\"621\" height=\"233\" \/><\/p>\n<p>In the next step, MySQL will be installed using the following command and allocating 160 MB.<\/p>\n<pre><code class=\"http\">sudo apt-get install mysql-server<\/code><\/pre>\n<p><img decoding=\"async\" class=\"size-full wp-image-25811 aligncenter\" src=\"https:\/\/www.arvancloud.ir\/help\/wp-content\/uploads\/2023\/02\/-\u0646\u0635\u0628-MySQL-\u062f\u0631-Ubuntu-5990302590108_2-1-jpeg.webp\" alt=\"\" width=\"796\" height=\"372\" \/><\/p>\n<p>When the installation is complete, you need to configure the built-in MySQL by using the following command.<\/p>\n<pre><code class=\"http\">sudo mysql_secure_installation<\/code><\/pre>\n<p>The first thing to do in this step is to identify the root user. You are recommended to answer all questions in this step using the y keyword. Nevertheless, be careful when asked &#8220;Remove the test database and access to it,&#8221; when using the y keyword, the MySQL test database will be removed.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-25813 aligncenter\" src=\"https:\/\/www.arvancloud.ir\/help\/wp-content\/uploads\/2023\/02\/-\u0646\u0635\u0628-MySQL-\u062f\u0631-Ubuntu-5990302590108_3-1-jpeg.webp\" alt=\"\" width=\"799\" height=\"1016\" \/><\/p>\n<p>After you complete the above step, MySQL will be running, and you can use the following command to verify that it is working as it should.<\/p>\n<pre><code class=\"http\">systemctl status mysql.service<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25815 aligncenter\" src=\"https:\/\/www.arvancloud.ir\/help\/wp-content\/uploads\/2023\/02\/-\u0646\u0635\u0628-MySQL-\u062f\u0631-Ubuntu-5990302590108_4-1-jpeg.webp\" alt=\"\" width=\"624\" height=\"177\" \/><\/p>\n<p>In the end, you may check the installed MySQL information, like the version and so on, with the following command:<\/p>\n<pre><code class=\"http\">sudo mysqladmin \u2013p \u2013u root version<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-25817 aligncenter\" src=\"https:\/\/www.arvancloud.ir\/help\/wp-content\/uploads\/2023\/02\/-\u0646\u0635\u0628-MySQL-\u062f\u0631-Ubuntu-5990302590108_5-1-jpeg.webp\" alt=\"\" width=\"624\" height=\"227\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL is among the most useful open-source database management systems with SQL, which is developed and supported by Oracle. Generally, MySQL is employed for accessing and modifying database information at all levels in database-related work, ranging from the information in a shopping list to the information of the users of a social network. In this [&hellip;]<\/p>\n","protected":false},"author":79,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"r1_post_views_count":"506","feedback_yes":"0","feedback_no":"0","ads_id_sidebar":"","ads_id_content":"","footnotes":""},"categories":[251,245],"tags":[],"class_list":["post-26239","post","type-post","status-publish","format-standard","hentry","category-app-development","category-cloud-server"],"lang":"en","translations":{"en":26239},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/users\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/comments?post=26239"}],"version-history":[{"count":1,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26239\/revisions"}],"predecessor-version":[{"id":28283,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26239\/revisions\/28283"}],"wp:attachment":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/media?parent=26239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/categories?post=26239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/tags?post=26239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}