{"id":1686,"date":"2016-03-30T19:23:12","date_gmt":"2016-03-30T23:23:12","guid":{"rendered":"http:\/\/blog-dev.bezko.xyz\/?p=1686"},"modified":"2017-04-19T15:57:06","modified_gmt":"2017-04-19T19:57:06","slug":"how-to-install-mysql-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/","title":{"rendered":"How to Install MySQL on CentOS 7"},"content":{"rendered":"<p>MySQL has been around for quite a while. It&#8217;s a popular relational database management system that exists since 1995. The following article will guide you on how to install MySQL standard release on CentOS 7.<\/p>\n<p>On CentOS 7, the official Oracle MySQL server is not available by default through the package manager. This is because Redhat decided to go with MariaDB as the official MySQL fork for CentOS 7. If you would prefer to use MariaDB, you can find the procedure here. If you prefer to proceed with Oracle\u2019s official packages, please keep reading.<\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<\/p>\n<p>\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Servers<\/a>) with CentOS 7 installed<\/p>\n<h2>Install MySQL<\/h2>\n<p>First, we will need to add the Oracle MySQL repository to yum. You can do that by acquiring the rpm for the repository and installing it on the server. For the MySQL 5.7 repository, you can issue the following command:<\/p>\n<p><code>yum install wget<br \/>\nwget https:\/\/dev.mysql.com\/get\/mysql57-community-release-el7-7.noarch.rpm<br \/>\nyum localinstall mysql57-community-release-el7-7.noarch.rpm<\/code><\/p>\n<p>Once that\u2019s done, installing MySQL is only a matter of running the yum command with the package name:<\/p>\n<p><code>yum install mysql-community-server<\/code><\/p>\n<p>You will then want to start the service:<\/p>\n<p><code>systemctl start mysqld<\/code><\/p>\n<p>To enable the service on-boot:<\/p>\n<p><code>systemctl enable mysqld<\/code><\/p>\n<p>This version of Oracle MySQL sets a root password by default. We need to retrieve it from the mysql logs.<\/p>\n<p><code>cat \/var\/log\/mysqld.log<br \/>\n2016-03-10T18:12:07.496135Z 1[Note] A temporary password is generated forroot@localhost: *password*<\/code><\/p>\n<p>With that password retrieved, we can now login. First though, let\u2019s run the mysql_secure_installation script.<\/p>\n<p><code>mysql_secure_installation<\/code><\/p>\n<p>Here, you will want to set a new root password. It is then recommended to remove anonymous users, disallow remote root login, remove the test database and reload the privileges table. Once this is done, you can now access MySQL using the usual command line interface.<\/p>\n<p><code>mysql \u2013u root -p<\/code><\/p>\n<h2>Conclusion<\/h2>\n<p>Your MySQL server is ready for production usage. You can now link your application to it and start using your new MySQL backend. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>The following article will guide you on how to install MySQL standard release on CentOS 7.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,50],"tags":[],"class_list":["post-1686","post","type-post","status-publish","format-standard","hentry","category-database","category-tutorials","operating_system-centos-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install MySQL on CentOS 7 - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now &amp; Try this popular database management system !\" \/>\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.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/\" \/>\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 CentOS 7 - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now &amp; Try this popular database management system !\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-30T23:23:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-19T19:57:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to Install MySQL on CentOS 7\",\"datePublished\":\"2016-03-30T23:23:12+00:00\",\"dateModified\":\"2017-04-19T19:57:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/\"},\"wordCount\":316,\"commentCount\":0,\"articleSection\":[\"Database\",\"Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/\",\"name\":\"How to Install MySQL on CentOS 7 - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"datePublished\":\"2016-03-30T23:23:12+00:00\",\"dateModified\":\"2017-04-19T19:57:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now & Try this popular database management system !\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/how-to-install-mysql-on-centos-7\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install MySQL on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install MySQL on CentOS 7 - Globo.Tech","description":"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now & Try this popular database management system !","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.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to Install MySQL on CentOS 7 - Globo.Tech","og_description":"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now & Try this popular database management system !","og_url":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/","og_site_name":"Globo.Tech","article_published_time":"2016-03-30T23:23:12+00:00","article_modified_time":"2017-04-19T19:57:06+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to Install MySQL on CentOS 7","datePublished":"2016-03-30T23:23:12+00:00","dateModified":"2017-04-19T19:57:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/"},"wordCount":316,"commentCount":0,"articleSection":["Database","Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/","url":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/","name":"How to Install MySQL on CentOS 7 - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-03-30T23:23:12+00:00","dateModified":"2017-04-19T19:57:06+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to install MySQL on your CentOS 7 server. Read now & Try this popular database management system !","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/how-to-install-mysql-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Install MySQL on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=1686"}],"version-history":[{"count":9,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1686\/revisions"}],"predecessor-version":[{"id":2800,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1686\/revisions\/2800"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=1686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=1686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=1686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}