{"id":666,"date":"2022-08-23T11:48:24","date_gmt":"2022-08-23T16:48:24","guid":{"rendered":"https:\/\/www.hostinglabs.net\/content\/?post_type=ht_kb&#038;p=666"},"modified":"2023-03-16T12:06:22","modified_gmt":"2023-03-16T17:06:22","slug":"como-instalar-y-configurar-mysql-8-en-centos-7","status":"publish","type":"ht_kb","link":"https:\/\/hostinglabs.net\/asistencia\/base-de-conocimientos\/como-instalar-y-configurar-mysql-8-en-centos-7\/","title":{"rendered":"Como instalar y configurar MySQL 8 en CentOS 7"},"content":{"rendered":"\n<p>En esta gu\u00eda te mostraremos como puedes instalar MySQL en CentOS 7.<\/p>\n\n\n\n<p>MySQL es un sistema de gesti\u00f3n de base de datos relacional m\u00e1s extendido en la actualidad.<\/p>\n\n\n\n<p>Recuerda que puedes solicitar la instalaci\u00f3n de estos y otros paquetes de software al contratar un Servidor Cloud con Hostinglabs o elegir un servidor con una plantilla existente en nuestro cat\u00e1logo.<\/p>\n\n\n\n<p><strong>Pre Requisitos<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tener acceso sudo o root&nbsp; al servidor.<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">PASO 01 &#8211; Actualizar mi sistema.<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo yum update\n<\/pre><\/div>\n\n\n<h5 class=\"wp-block-heading\">PASO 02- En caso no tener instalado el gestor de paquetes \u00abwget\u00bb utilice este comando:<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo yum install wget\n<\/pre><\/div>\n\n\n<h5 class=\"wp-block-heading\">PASO 03 &#8211; Descargamos el repositorio.<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nwget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-2.noarch.rpm\n<\/pre><\/div>\n\n\n<h5 class=\"wp-block-heading\">PASO 04- Agregamos el repositorio.<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rpm -ivh mysql80-community-release-el7-2.noarch.rpm\n<\/pre><\/div>\n\n\n<h5 class=\"wp-block-heading\">PASO 05 &#8211; Instalar MySQL<\/h5>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo yum install mysql-server\n<\/pre><\/div>\n\n\n<p>Cuando se instala MySQL en CentOS 7, se genera una clave root temporal, veremos esa clave ejecutando el siguiente comando:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"363\" height=\"32\" src=\"https:\/\/www.hostinglabs.net\/content\/wp-content\/uploads\/2023\/03\/image-7.png\" alt=\"\" class=\"wp-image-968\" srcset=\"https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/image-7.png 363w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/image-7-300x26.png 300w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/image-7-50x4.png 50w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/image-7-60x5.png 60w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/image-7-100x9.png 100w\" sizes=\"(max-width: 363px) 100vw, 363px\" \/><\/figure>\n\n\n\n<p>Para cambiarla, ejecutamos el siguiente comando:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo mysql_secure_installation\n<\/pre><\/div>\n\n\n<p>Ingresa la clave temporal y nos mostrar\u00e1 el siguiente mensaje y colocaremos nuestra nueva contrase\u00f1a:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nThe existing password for the user account root has expired. Please set a new password. \nNew password: \nRe-enter new password:\n<\/pre><\/div>\n\n\n<p>Arrancamos el servicio:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo systemctl start mysqld\n<\/pre><\/div>\n\n\n<p>Nos pedir\u00e1 nuestra clave:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"305\" height=\"41\" src=\"https:\/\/www.hostinglabs.net\/content\/wp-content\/uploads\/2023\/03\/3-1.png\" alt=\"\" class=\"wp-image-973\" srcset=\"https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/3-1.png 305w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/3-1-300x40.png 300w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/3-1-50x7.png 50w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/3-1-60x8.png 60w, https:\/\/hostinglabs.net\/asistencia\/wp-content\/uploads\/2023\/03\/3-1-100x13.png 100w\" sizes=\"(max-width: 305px) 100vw, 305px\" \/><\/figure>\n\n\n\n<p>Si todo esta correcto nos aparecer\u00e1 este resultado:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nWelcome to the MySQL monitor.  Commands end with ; or \\g. \nYour MySQL connection id is 22 \nServer version: 8.0.20 \nCopyright (c) 2000, 2020, Oracle and\/or its affiliates. All rights reserved. \nOracle is a registered trademark of Oracle Corporation and\/or its affiliates. Other names may be trademarks of their respective owners. \nType &#039;help;&#039; or &#039;\\h&#039; for help. Type &#039;\\c&#039; to clear the current input statement.\n<\/pre><\/div>\n\n\n<p><strong>Comandos b\u00e1sicos de MySQL:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>show databases;<\/td><td>Lista las bases de datos que tengamos.<\/td><\/tr><tr><td>connect[name_database];<\/td><td>Conectarse a la base de datos<\/td><\/tr><tr><td>show tables;<\/td><td>Lista las tablas de la base de datos que estemos conectados<\/td><\/tr><tr><td>show tables status;<\/td><td>Muestra informaci\u00f3n sobre las tablas de la base de datos.<\/td><\/tr><tr><td>describe[table]<\/td><td>Muestra la estructura de una tabla de la base de datos.<\/td><\/tr><tr><td>drop table [table]<\/td><td>Eliminar una tabla que incluye los registros y la estructura.<\/td><\/tr><tr><td>drop table if exists [table];<\/td><td>Si existe la tabla, la elimina.<\/td><\/tr><tr><td>truncate table [table];<\/td><td>Elimina los registros de una tabla, pero mantiene la estructura.<\/td><\/tr><tr><td>rename table [table] to [nuevo nombre de tabla];<\/td><td>Renombrar una tabla de base de datos.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u00a1Listo! <\/strong>Ya aprendiste a como instalar y configurar MySQL\u00a0 en CentOS, si tienes problemas al realizar alguno de los pasos, recuerda que siempre puedes ponerte en contacto con nosotros a trav\u00e9s de nuestros canales de atenci\u00f3n.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>En esta gu\u00eda te mostraremos como puedes instalar MySQL en CentOS 7. MySQL es un sistema de gesti\u00f3n de base de datos relacional m\u00e1s extendido en la actualidad. Recuerda que puedes solicitar la instalaci\u00f3n de estos y otros paquetes de software al contratar un Servidor Cloud con Hostinglabs o elegir&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[38],"ht-kb-tag":[],"class_list":["post-666","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-linux"],"_links":{"self":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/666"}],"collection":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/comments?post=666"}],"version-history":[{"count":6,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/666\/revisions"}],"predecessor-version":[{"id":975,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb\/666\/revisions\/975"}],"wp:attachment":[{"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/media?parent=666"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb-category?post=666"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/hostinglabs.net\/asistencia\/wp-json\/wp\/v2\/ht-kb-tag?post=666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}