#317 Update out-dated information and aesthetic change for Databases
Closed 2 years ago by pbokoc. Opened 3 years ago by hhlp.
Unknown source sql  into  master

file modified
+2 -1
@@ -83,7 +83,6 @@

  * xref:openh264.adoc[OpenH264]

  * xref:package-management.adoc[Package management system]

  * xref:packagekit-not-found.adoc[PackageKit Items Not Found]

- * xref:postgresql.adoc[PostgreSQL]

  //FIXME * xref:uefi-with-qemu.adoc[Using UEFI with QEMU]

  * xref:upgrading-fedora-online.adoc[Upgrading Fedora using package manager]

  
@@ -93,6 +92,8 @@

  

  * Databases

  ** xref:installing-mysql-mariadb.adoc[Installing, Configuring and Troubleshooting MySql/MariaDB]

+ ** xref:postgresql.adoc[PostgreSQL]

+ ** xref:manage-sql-server.adoc[How to Manage your SQL Server from GUI]

  

  * FAQ

  ** xref:fedora-and-red-hat-enterprise-linux.adoc[Difference between Fedora and Red Hat Enterprise Linux]

@@ -0,0 +1,103 @@

+ == How to Manage SQL SERVER from GUI

+ 

+ For database management, it is more user-friendly to use graphical tools:

+ 

+ - MySQL/Mariadb:

+ 

+ ** phpMyAdmin.noarch : A web interface for MySQL and MariaDB

+ 

+ ----

+ sudo dnf install phpMyAdmin

+ ----

+ 

+ - MySQL Specific:

+ 

+ ** MySQL Workbench is a unified visual tool for database architects, developers, and DBAs.

+ 

+ - Mixed:

+ 

+ ** DBeaver Community   Universal Database Manager.

+ 

+ ----

+ flatpak install io.dbeaver.DBeaverCommunity

+ ----

+ 

+ ** PostgreSQL client for DBeaver Community  

+ 

+ ----

+ flatpak install io.dbeaver.DBeaverCommunity.Client.pgsql

+ ----

+ 

+ ** MariaDB client for DBeaver Community     

+ 

+ ----

+ flatpak install io.dbeaver.DBeaverCommunity.Client.mariadb

+ ----

+ 

+ - PostgreSQL:

+ 

+ ** pgadmin3 Graphical client for PostgreSQL

+ 

+ ----

+ sudo dnf install pgadmin3

+ ----

+ 

+ ** phpPgAdmin - A web interface for PostgreSQL

+ 

+ for Fedora <= 32

+ 

+ ----

+ sudo dnf install phpPgAdmin

+ ----

+ 

+ for Fedora >= 33

+ 

+ [[installation]]

+ === Installation

+ 

+ The installation of the postgresql GUI web-server is a little bit different

+ in comparison to older Fedora because the package is out of the repo.

+ 

+ 1. We assume you have php installed on your server and Working.

+ 

+ 2. Download the latest from GitHub repo:

+ 

+ https://github.com/phppgadmin/phppgadmin/releases

+ 

+ ----

+ sudo tar xf phpPgAdmin-x.y.z.tar.bz2 -C /var/www/phpPgadmin

+ ----

+ 

+ In order to make phpPgAdmin navigable, we create a configuration file for the web service (Apache in this case):

+ 

+ ----

+ sudo nano /etc/httpd/conf.d/phpPgAdmin.conf

+ ----

+ 

+ The content will be an alias that will point to the installation path of 

+ the application:

+ 

+ ----

+ Alias /phppgadmin /var/www/phpPgAdmin

+ ----

+ 

+ Save the file and Reload the Web Service:

+ 

+ ----

+ sudo systemctl reload httpd

+ ----

+ 

+ phpPgAdmin requires the presence in Fedora 31 of certain PHP extensions, 

+ mainly the one that allows the connection with the database service, which 

+ we will install from the system repositories:

+ 

+ ----

+ sudo dnf install -y php-pgsql

+ ----

+ 

+ To access the web installer of phpPgAdmin in Fedora from a browser we will

+ indicate the IP address or DNS name of the server followed by the alias we

+ have defined and follow the steps requested.

+ 

+ See a typo, something missing or out of date, or anything else which can be

+ improved? Edit this document at https://pagure.io/fedora-docs/quick-docs.

@@ -11,26 +11,26 @@

  However, this is not recommended.

  

  ....

- $ sudo yum install postgresql-server postgresql-contrib

+ sudo yum install postgresql-server postgresql-contrib

  ....

  

  Or with dnf in Fedora 22 and later versions:

  

  ....

- $ sudo dnf install postgresql-server postgresql-contrib

+ sudo dnf install postgresql-server postgresql-contrib

  ....

  

  The postgresql server is turned off and disabled by default. You can

  enable its start during the boot using following command:

  

  ....

- $ sudo systemctl enable postgresql

+ sudo systemctl enable postgresql

  ....

  

  You can start the postgresql server only when necessary as follows.

  

  ....

- $ sudo systemctl start postgresql 

+ sudo systemctl start postgresql 

  Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.

  ....

  
@@ -38,7 +38,7 @@

  The error log describes the problem and its solution.

  

  ....

- $ journalctl -xn

+ journalctl -xn

  -- Logs begin at Mon 2013-11-04 14:38:33 CET, end at Thu 2013-11-14 11:45:56 CET. --

  Nov 14 11:45:34 mlich-lenovo.usersys.redhat.com sudo[2054]: jmlich : TTY=pts/2 ; PWD=/home/jmlich ; USER=root ; COMMAND=/bin/systemctl status postgresql

  Nov 14 11:45:37 mlich-lenovo.usersys.redhat.com sudo[2073]: jmlich : TTY=pts/2 ; PWD=/home/jmlich ; USER=root ; COMMAND=/bin/systemctl status postgresql
@@ -68,13 +68,13 @@

  creates the configuration files postgresql.conf and pg_hba.conf

  

  ....

- $ sudo postgresql-setup initdb

+ sudo postgresql-setup initdb

  ....

  

  Or on Fedora 22 and later:

  

  ....

- $ sudo postgresql-setup --initdb --unit postgresql

+ sudo postgresql-setup --initdb --unit postgresql

  ....

  

  [[upgrade]]
@@ -92,7 +92,7 @@

  `postgresql-upgrade`:

  

  ....

- $ postgresql-setup upgrade

+ postgresql-setup upgrade

  

  Redirecting to /bin/systemctl stop  postgresql.service

  Upgrading database: OK
@@ -118,24 +118,6 @@

  You can also upgrade by dumping your database and loading it again. For

  more information, see the link:#link-upgrade[official documentation].

  

- [[tips-and-tricks]]

- == Tips and tricks

- 

- For database management, it is more user-friendly to use graphical tools such as

- phpPgAdmin or pgadmin3

- 

- ....

- $ sudo yum install phpPgAdmin

- $ sudo yum install pgadmin3

- ....

- 

- Or with dnf in Fedora 22 and later versions:

- 

- ....

- $ sudo dnf install phpPgAdmin

- $ sudo dnf install pgadmin3

- ....

- 

  [[firewall]]

  == Firewall

  
@@ -143,16 +125,16 @@

  `postgresql.conf`). In firewalld you can open it like this:

  

  ....

- $ # make it last after reboot

- $ firewall-cmd --permanent --add-port=5432/tcp

- $ # change runtime configuration

- $ firewall-cmd --add-port=5432/tcp

+ # make it last after reboot

+ firewall-cmd --permanent --add-port=5432/tcp

+ # change runtime configuration

+ firewall-cmd --add-port=5432/tcp

  ....

  

  In the case of iptables:

  

  ....

- $ iptables -A INPUT -p tcp --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT

+ iptables -A INPUT -p tcp --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT

  ....

  

  Bear in mind that you probably don't want to open your database server
@@ -167,13 +149,13 @@

  new location:

  

  ....

- $ semanage fcontext -a -t postgresql_db_t "/my/new/location(/.*)?"

+ semanage fcontext -a -t postgresql_db_t "/my/new/location(/.*)?"

  ....

  

  If the default port doesn't work for you, you may need to map postgre's port type to your desired port:

  

  ....

- $ semanage port -a -t postgresql_port_t -p tcp 5433

+ semanage port -a -t postgresql_port_t -p tcp 5433

  ....

  

  If you install a webapp that wants to communicate with PostgreSQL via
@@ -181,7 +163,7 @@

  host:

  

  ....

- # setsebool -P httpd_can_network_connect_db on

+ setsebool -P httpd_can_network_connect_db on

  ....

  

  [[user-creation-and-database-creation]]
@@ -191,13 +173,13 @@

  First, you have to switch the user to interact with `postgres`:

  

  ....

- # su - postgres

+ su - postgres

  ....

  

  and then run postgre's interactive shell:

  

  ....

- $ psql

+ psql

  psql (9.3.2)

  Type "help" for help.

  
@@ -214,8 +196,8 @@

  You can do this from the system shell as well:

  

  ....

- $ createuser lenny

- $ createdb --owner=lenny carl

+ createuser lenny

+ createdb --owner=lenny carl

  ....

  

  It might be good idea to add password for the `postgres` user:

What this change accomplishes:

  1. Move PostgreSql to Database Section
  2. Remove Tips and Trips in PostgreSQL and move to the following
  3. Add manage-sql-server.adoc and add GUI for Mysql/MariaDB/PostgreSQL
  4. Add install information phpPgadmin because in fedora 33 is out of repo.

Metadata Update from @pbokoc:
- Request assigned

3 years ago

(Fixes #320)

Hi @hhlp, thanks for the PR. Everything looks good, but could you please remove the # and $ prompts from commands in modules/ROOT/pages/postgresql.adoc?

Don't worry about the conflict, I'll merge this PR locally once it's finished.

Metadata Update from @pbokoc:
- Pull-request tagged with: needs changes

3 years ago

1 new commit added

  • Update modules/ROOT/pages/postgresql.adoc
3 years ago

ohh my bag

I've made the changed and don't notify -> @pbokoc

Regards.,

@hhlp And I guess I missed it in notifications :). Anyway, all looks good; as I said I'll do a local merge and close the PR.

Pull-Request has been closed by pbokoc

2 years ago