{"id":1851,"date":"2019-09-18T13:32:13","date_gmt":"2019-09-18T19:32:13","guid":{"rendered":"https:\/\/ugit.siua.ac.cr\/?p=1851"},"modified":"2019-09-18T13:32:13","modified_gmt":"2019-09-18T19:32:13","slug":"mariadb-instalar-servidor","status":"publish","type":"post","link":"https:\/\/sada.services\/?p=1851","title":{"rendered":"MariaDB: Instalar servidor"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>En esta gu\u00eda vamos instalar y configurar un servidor de bases de datos MYSQL, sobre un contenedor de PROXMOX con debian 9<\/li><li>Establecemos una ip fija:\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/ugit.blog.siua.ac.cr\/index.php?controller=post&amp;action=view&amp;id_post=196\" target=\"_blank\">gu\u00eda<\/a><\/li><li>Creamos el usuario ugit:\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/ugit.blog.siua.ac.cr\/index.php?controller=post&amp;action=view&amp;id_post=194\" target=\"_blank\">gu\u00eda<\/a><\/li><li>Actualizamos el sistema:\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/ugit.blog.siua.ac.cr\/index.php?controller=post&amp;action=view&amp;id_post=199\" target=\"_blank\">gu\u00eda<\/a><\/li><li>Instalamos la gu\u00eda de seguridad :\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/ugit.blog.siua.ac.cr\/index.php?controller=post&amp;action=view&amp;id_post=203\" target=\"_blank\">gu\u00eda<\/a><\/li><li>Instalamos mysql<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install mysql-server mysql-client<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuramos el servicio<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Mandamos a ejecutar la configuraci\u00f3n inicial<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>RESULTADO<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br> SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<br><br>In order to log into MariaDB to secure it, we'll need the current<br>password for the root user. If you've just installed MariaDB, and<br>you haven't set the root password yet, the password will be blank,<br>so you should just press enter here.<br><br>Enter current password for root (enter for none): <strong>HB3<\/strong><br><br>OK, successfully used password, moving on...<br><br>Setting the root password ensures that nobody can log into the MariaDB<br>root user without the proper authorisation.<br><br>You already have a root password set, so you can safely answer 'n'.<br><br>Change the root password? [Y\/n] <strong>n<\/strong><br><br>&nbsp;... skipping.<br><br>By default, a MariaDB installation has an anonymous user, allowing anyone<br>to log into MariaDB without having to have a user account created for<br>them. This is intended only for testing, and to make the installation<br>go a bit smoother. You should remove them before moving into a<br>production environment.<br><br>Remove anonymous users? [Y\/n] <strong>Y<\/strong><br>&nbsp;... Success!<br><br>Normally, root should only be allowed to connect from 'localhost'. This<br>ensures that someone cannot guess at the root password from the network.<br><br>Disallow root login remotely? [Y\/n] <strong>Y<\/strong><br>&nbsp;... Success!<br><br>By default, MariaDB comes with a database named 'test' that anyone can<br>access. This is also intended only for testing, and should be removed<br>before moving into a production environment.<br><br>Remove test database and access to it? [Y\/n] <strong>Y<\/strong><br><br>&nbsp;- Dropping test database...<br> ... Success!<br> - Removing privileges on test database...<br> ... Success!<br><br>Reloading the privilege tables will ensure that all changes made so far<br>will take effect immediately.<br><br>Reload privilege tables now? [Y\/n] <strong>Y<\/strong><br><br>&nbsp;... Success!<br><br>Cleaning up...<br><br>All done! If you've completed all of the above steps, your MariaDB<br>installation should now be secure.<br><br>Thanks for using MariaDB!<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Crear usuario remoto<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Descomentamos que solo se pueda conectar por la ip local, abrimos<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/etc\/mysql\/mariadb.conf.d\/50-server.cnf  <\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>&nbsp;Modificamos<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>bind-address           = 127.0.0.1\nX\n#bind-address           = 127.0.0.1<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Reiniciamos el servicio<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>service mariadb restart<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Ingresamos por la terminal con el usuario \u00abroot\u00bb<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Creamos el usuario remoto<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE USER 'remoto'@'%' IDENTIFIED BY 'RB0';<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Le otorgamos privilegios<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT ALL PRIVILEGES ON *.* TO 'remoto'@'%' IDENTIFIED BY 'RB0' with grant option;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Recargamos los privilegios<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>FLUSH PRIVILEGES;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Verificamos los permisos<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>SHOW GRANTS FOR remoto;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>RESULTADO<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">+----------------------------------------------------------------------------------------------------------------------------------+<br>| Grants for remoto@% |<br>+----------------------------------------------------------------------------------------------------------------------------------+<br>| GRANT ALL PRIVILEGES ON *.* TO 'remoto'@'%' IDENTIFIED BY PASSWORD '*dddddd' WITH GRANT OPTION |<br>+----------------------------------------------------------------------------------------------------------------------------------+<br>1 row in set (0.00 sec)<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Si deseamos remover privilegios<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>REVOKE ALL PRIVILEGES ON basedatos.* FROM remoto;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Si deseamos eliminar el usuario<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP USER remoto;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>En esta gu\u00eda vamos instalar y configurar un servidor de bases de datos MYSQL, sobre un contenedor de PROXMOX con debian 9 Establecemos una ip fija:\u00a0gu\u00eda Creamos el usuario ugit:\u00a0gu\u00eda Actualizamos el sistema:\u00a0gu\u00eda Instalamos la gu\u00eda de seguridad :\u00a0gu\u00eda Instalamos mysql Configuramos el servicio Mandamos a ejecutar la configuraci\u00f3n inicial RESULTADO NOTE: RUNNING ALL PARTS [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1852,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[136],"tags":[],"class_list":["post-1851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mariadb"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1851"}],"version-history":[{"count":1,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions"}],"predecessor-version":[{"id":1853,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/posts\/1851\/revisions\/1853"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=\/wp\/v2\/media\/1852"}],"wp:attachment":[{"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sada.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}