{"id":1837,"date":"2014-08-11T17:05:00","date_gmt":"2014-08-11T22:05:00","guid":{"rendered":"http:\/\/linuxitos.com\/main\/instalar-postgresql-y-pgadmin-iii-en-fedora\/"},"modified":"2014-08-11T17:05:00","modified_gmt":"2014-08-11T22:05:00","slug":"instalar-postgresql-y-pgadmin-iii-en-fedora","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/instalar-postgresql-y-pgadmin-iii-en-fedora\/","title":{"rendered":"Instalar PostgreSQL y pgAdmin III en fedora"},"content":{"rendered":"<div style=\"text-align: justify;\">PostgreSQL es el motor de bases de datos m\u00e1s usado del 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:<\/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=\"background-color: transparent;\"><b><span style=\"color: white;\">su -c 'yum -y install postgresql-server pgadmin3'<\/span><\/b><\/span><\/pre>\n<p>Una vez instalado, cambiamos la contrase\u00f1a del usuario postgres:<\/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 \/>$&nbsp;<\/span><\/b><\/span><span style=\"background-color: transparent;\"><b><span style=\"color: white;\">su -c 'passwd postgres'<\/span><\/b><\/span><\/pre>\n<p>Inicializar la base de datos:<\/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=\"background-color: transparent;\"><b><span style=\"color: white;\">su -c 'service postgresql initdb'<\/span><\/b><\/span><\/pre>\n<p>Y procedemos a editar la configuraci\u00f3n de PostgreSQL:<\/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: small; line-height: normal; white-space: normal;\"><span style=\"color: white;\"><b>$ su -c 'gedit &nbsp;\/var\/lib\/pgsql\/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:<\/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: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ su -c 'gedit &nbsp;\/var\/lib\/pgsql\/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<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: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ su -c '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: 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: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ sudo 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: 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: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ sudo systemctl start postgresql<\/span><\/b><\/span><span style=\"font-family: 'Times New Roman'; font-size: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">&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: 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: small; line-height: normal; white-space: normal;\"><b><span style=\"color: white;\">$ su -c '\/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>$ su 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: 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.<br \/>Fuente:<br \/>https:\/\/fedoraproject.org\/wiki\/PostgreSQL<br \/>http:\/\/www.piensaenbinario.com\/2010\/01\/instalar-postgresql-server-pgadmin-iii.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PostgreSQL es el motor de bases de datos m\u00e1s usado del 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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221,7,87,1494,357,122,220,144],"tags":[],"class_list":["post-1837","post","type-post","status-publish","format-standard","hentry","category-comandos","category-fedora","category-gnome","category-instalacion-postgresql","category-install","category-postgresql","category-terminal","category-yum"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1837","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=1837"}],"version-history":[{"count":0,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/1837\/revisions"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=1837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=1837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=1837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}