{"id":1649,"date":"2016-02-05T18:16:00","date_gmt":"2016-02-06T00:16:00","guid":{"rendered":"http:\/\/linuxitos.com\/main\/instalar-postgresql-y-pgadmin-iii-en-fedora-23\/"},"modified":"2016-02-05T18:16:00","modified_gmt":"2016-02-06T00:16:00","slug":"instalar-postgresql-y-pgadmin-iii-en-fedora-23","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/instalar-postgresql-y-pgadmin-iii-en-fedora-23\/","title":{"rendered":"Instalar PostgreSQL y pgAdmin III en Fedora 23"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">\n<div style=\"text-align: justify;\">\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/3.bp.blogspot.com\/-GlyfheVmfF0\/VrUsPfYPsnI\/AAAAAAAABqg\/TCfoGFVmOvQ\/s1600\/Captura%2Bde%2Bpantalla%2Bde%2B2016-02-05%2B17-15-21.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"358\" src=\"https:\/\/3.bp.blogspot.com\/-GlyfheVmfF0\/VrUsPfYPsnI\/AAAAAAAABqg\/TCfoGFVmOvQ\/s640\/Captura%2Bde%2Bpantalla%2Bde%2B2016-02-05%2B17-15-21.png\" width=\"640\" \/><\/a><\/div>\n<\/div>\n<div style=\"text-align: justify;\">PostgreSQL es un motor de bases de datos muy utilizado en el mundo del  software libre y cuenta con una gran trayectoria en el mercado  empresarial por su robustez y fiabilidad. Por otra parte, PGAdmin III es  una interfaz gr\u00e1fica para administrar PostgreSQL que si bien no es tan  avanzada como algunos administradores quisieran, sin duda es una  excelente opci\u00f3n para operar Postgres fuera de la consola de la  comandos.<\/div>\n<p>Para instalar PostgreSQL y PGAdmin III en Fedora, es necesario ingresar como usuario root:<\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\">su -<\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\">dnf<\/span><\/b><\/span><span style=\"background-color: transparent;\"><b><span style=\"color: white;\"> -y install postgresql-server pgadmin3<\/span><\/b><\/span><\/pre>\n<p>Una vez instalado, cambiamos la contrase\u00f1a del usuario postgres:<span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"background-color: transparent;\"><b><span style=\"color: white;\">passwd postgres<\/span><\/b><\/span><\/pre>\n<p>Inicializar la base de datos:<span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"background-color: transparent;\"><b><span style=\"color: white;\">service postgresql initdb<\/span><\/b><\/span><\/pre>\n<p>Y procedemos a editar la configuraci\u00f3n de PostgreSQL:<span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><span style=\"color: white;\"><b>gedit &nbsp;\/var\/lib\/pgsql\/9.4\/data\/postgresql.conf<\/b><\/span><\/span><\/pre>\n<div style=\"text-align: justify;\">En el archivo de configuraci\u00f3n busque edite la l\u00ednea:<\/div>\n<p>#listen_addresses = &#8216;localhost&#8217;<br \/>Reemplazarlo por:<br \/>listen_addresses = &#8216;*&#8217;<\/p>\n<p>Y la l\u00ednea:<br \/>#port = 5432<br \/>Reemplazarlo por:<br \/>port = 5432<\/p>\n<div style=\"text-align: justify;\">Guardar y cerrar el editor de texto. Con \u00e9stos cambios, configuramos  PostgreSQL server para \u00abescuchar\u00bb las conexiones desde cualquier  direcci\u00f3n por el puerto 5432.<\/div>\n<p>Ahora procedemos a editar la configuraci\u00f3n de autenticaci\u00f3n editando el archivo pg_hba.conf:<span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ su -c 'gedit &nbsp;\/var\/lib\/pgsql\/9.4\/data\/pg_hba.conf'<\/span><\/b><\/span><\/pre>\n<p>Buscamos la l\u00ednea:<br \/><span style=\"color: blue;\">host all all 127.0.0.1\/32 ident<\/span><\/p>\n<p>Y reemplazar por:<br \/><span style=\"color: blue;\">host all all 127.0.0.1\/32 md5<\/span><\/p>\n<div style=\"text-align: justify;\">Con \u00e9ste cambio le decimos a PostgreSQL que las conexiones desde el mismo servidor (localhost) deben autenticarse por md5.<\/div>\n<div style=\"text-align: justify;\">Nota: Si desea conectarse desde otro equipo o red remota a\u00f1ada una l\u00ednea  similar con la direcci\u00f3n IP del equipo o red desde el que se conectar\u00e1.  Incluso puede aceptar conexiones desde cualquier lugar con la direcci\u00f3n  0.0.0.0. Consulte  http:\/\/www.postgresql.org\/docs\/8.4\/static\/auth-pg-hba-conf.html para  obtener m\u00e1s informaci\u00f3n del archivo pg_hba.conf.<\/div>\n<p><\/p>\n<div style=\"text-align: justify;\">Guardar el archivo y cerrar el editor de texto. Una vez hecho \u00e9sto  agregamos PostgreSQL como servicio al arranque para que sea inicializado  cada vez que se enciende el equipo:<\/div>\n<p><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">chkconfig postgresql on<\/span><\/b><\/span><\/pre>\n<p>habilitar que inicie postgresql al iniciar el sistema, para evitar ejecutar la linea que sigue cada vez que se requiera utilizar<\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\">Ejecutar el siguiente comando<br \/><\/span><\/b><\/span><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">\/*la instrucci\u00f3n que sigue es para que el servidor arranque cuando inicia el sistema operativo*\/&nbsp;<\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">systemctl enable postgresql&nbsp;&nbsp;<br \/><\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">\/*la instrucci\u00f3n que sigue es para iniciar el servidor de postgresql*\/<\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">systemctl start postgresql<\/span><\/b><\/span><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\"><\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">\/*esta linea de comandos la ejecutan en caso de que la de arriba no funcione*\/&nbsp;<\/span><\/b><\/span><\/pre>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">\/etc\/init.d\/postgresql start<\/span><\/b><\/span><\/pre>\n<div style=\"text-align: justify;\">Ahora podemos proceder a cambiar la contrase\u00f1a propiamente del usuario  PostgreSQL en la base de datos (Nos pedir\u00e1 la constrase\u00f1a del usuario  Postgres de Unix).<\/div>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\">Ejecutar el siguiente comando<br \/><\/span><\/b><\/span><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><span style=\"color: white;\"><b>postgres<\/b><\/span><\/div><br \/><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><span style=\"color: white;\"><b>contrase\u00f1a:&nbsp;<\/b><\/span><\/div><br \/><\/pre>\n<p>Una vez como usuario Postgres ejecutamos: (Una instrucci\u00f3n por l\u00ednea):<\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: Verdana, sans-serif;\"><b><span style=\"color: white;\">Ejecutar el siguiente comando<br \/><\/span><\/b><\/span><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><b><span style=\"color: white;\">psql<\/span><\/b><\/div><br \/><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><b><span style=\"color: white;\">ALTER USER postgres WITH PASSWORD 'mypasswd';<\/span><\/b><\/div><br \/><\/pre>\n<p>Si la instrucci\u00f3n se ejecut\u00f3 con \u00e9xito debe mostrar:<\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><span style=\"font-family: 'Times New Roman'; font-size: x-small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">ALTER ROLE<\/span><\/b><\/span><\/pre>\n<p>Nota: Reemplaza mypasswd por su contrase\u00f1a.<br \/>El cambio est\u00e1 hecho. Para salir (Una instrucci\u00f3n por l\u00ednea):<\/p>\n<pre style=\"background: 0% 0% no-repeat rgb(0, 0, 0); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(0, 0, 0); font-size: 13px; line-height: 20px; margin: 8px 15px; opacity: 0.85; padding: 9.5px; text-shadow: none; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;\"><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><b><span style=\"color: white;\">q<\/span><\/b><\/div><br \/><div style=\"font-family: 'Times New Roman'; font-size: medium; line-height: normal; white-space: normal;\"><br \/><b><span style=\"color: white;\">exit<\/span><\/b><\/div><br \/><\/pre>\n<p>Conectarse a la Base de datos desde PGAdmin III<\/p>\n<div style=\"text-align: justify;\">Para abrir PGAdmin III vaya al men\u00fa Aplicaciones =&gt; Programaci\u00f3n =&gt; pgAdmin III ver\u00e1 la pantalla principal de pgAdmin:<\/div>\n<p>Para conectarse a la base de datos, haga clic sobre la \u00abtoma de  corriente\u00bb o \u00abenchufe\u00bb en la parte superior, o en el men\u00fa Archivo =&gt;  Add Server.<br \/>Ver\u00e1 el cuadro de di\u00e1logo de configuraci\u00f3n del servidor:<br \/>La informaci\u00f3n a ingresar ser\u00e1:<\/p>\n<p>Nombre: BD<br \/>Host: 127.0.0.1<br \/>Port: 5432<br \/>Maintenance DB: postgres<br \/>Username: postgres<br \/>Password: sucontrase\u00f1a<\/p>\n<p>Y eso ser\u00eda todo. Gracias por leer.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL es un motor de bases de datos muy utilizado en el mundo del software libre y cuenta con una gran trayectoria en el mercado empresarial por su robustez y fiabilidad. Por otra parte, PGAdmin III es una interfaz gr\u00e1fica para administrar PostgreSQL que si bien no es tan avanzada como algunos administradores quisieran, sin [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[631,7,808,805,806,807,169,122],"tags":[],"class_list":["post-1649","post","type-post","status-publish","format-standard","hentry","category-631","category-fedora","category-iii","category-instalar-postgresql-en-fedora","category-install-postgresql","category-install-postgresql-in-fedora","category-pgadmin","category-postgresql"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=1649"}],"version-history":[{"count":0,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1649\/revisions"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=1649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=1649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=1649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}