- Как установить PostgreSQL с pgAdmin4 на Linux Mint 20
- Шаг 1: Установите базу данных PostgreSQL на Linux Mint
- Шаг 2: Установите pgAdmin4 на Linux Mint
- Installing pgAdmin 4 on Linux Mint 20 (ulyana)
- What Exactly is pgAdmin?
- Follow the following steps to install pgAdmin4 on your Linux/Ubuntu machine
- How to Install PostgreSQL with pgAdmin4 on Linux Mint 20
- Step 1: Install PostgreSQL Database on Linux Mint
- Step 2: Install pgAdmin4 on Linux Mint
- If You Appreciate What We Do Here On TecMint, You Should Consider:
Как установить PostgreSQL с pgAdmin4 на Linux Mint 20
pgAdmin — это многофункциональный инструмент управления интерфейсом с открытым исходным кодом. Который позволяет легко администрировать и управлять реляционной базой данных PostgreSQL из веб-браузера.
Он обеспечивает простой в использовании пользовательский интерфейс, который упрощает создание и мониторинг баз данных, а так же объектов базы данных. PgAdmin 4 является улучшением более раннего инструмента pgAdmin и доступен для систем Linux, Windows, macOS.
В этой статье вы узнаете, как установить PostgreSQL с помощью pgAdmin4 на Linux Mint 20.
Шаг 1: Установите базу данных PostgreSQL на Linux Mint
1. Для начала запустите терминал и обновите пакеты с помощью диспетчера пакетов apt, как показано ниже.
После завершения обновления перейдите к следующему шагу.
Поскольку pgAdmin4 предоставляет интерфейс frontend для управления объектами базы данных PostgreSQL. Очень важно сначала установить PostgreSQL.
2. Для этого требуется установить пакет postgresql и postgresql-contrib, который предлагает расширение функций PostgreSQL.
$ sudo apt install postgresql postgresql-contrib
3. Обычно PostgreSQL запускается автоматически при загрузке. Вы можете подтвердить это с помощью приведенной ниже команды:
$ sudo systemctl status postgresql
4. Чтобы войти в PostgreSQL, для начала переключитесь на пользователя postgres. Пользователь Postgres входит в комплект поставки по умолчанию вместе с установкой PostgreSQL. Затем выполните команду psql, как показано на рисунке.
5. Кроме того, вы можете проверить, принимает ли сервер базы данных входящие соединения.
Шаг 2: Установите pgAdmin4 на Linux Mint
pgAdmin4 доступен для Ubuntu 16.04 и более поздних версий. Он его можно установить с помощью APT package manager. Разработчики Pgadmi4 еще не включили поддержку Linux Mint позволяющую пользователям легко устанавливать инструмент управления фронтендом с помощью APT package manager.
6. Единственный жизнеспособный вариант — это установить pgAdmin4 из виртуальной среды. Итак, для начала мы установим необходимые пакеты, как показано на рисунке.
$ sudo apt install libgmp3-dev build-essential libssl-dev
7. Затем установите виртуальную среду Python и связанные с ней зависимости.
$ sudo apt install python3-virtualenv python3-dev libpq-dev
8. Далее создайте каталог, в котором вы будете создавать виртуальную среду.
9. Затем создайте виртуальную среду, как показано ниже. Здесь pgadmin4env — это имя виртуальной среды.
10. Как только виртуальная среда установлена, активируйте ее, как показано ниже.
11. Затем требуется использовать инструмент pip для установки pgadmin4.
12. Далее создайте файл конфигурации config_local.py.
$ sudo nano pgadmin4env/lib/python3.8/site-packages/pgadmin4/config_local.py
И добавьте в этот файл строки которые написаны ниже.
import os
DATA_DIR = os.path.realpath(os.path.expanduser(u’
/.pgadmin/’))
LOG_FILE = os.path.join(DATA_DIR, ‘pgadmin4.log’)
SQLITE_PATH = os.path.join(DATA_DIR, ‘pgadmin4.db’)
SESSION_DB_PATH = os.path.join(DATA_DIR, ‘sessions’)
STORAGE_DIR = os.path.join(DATA_DIR, ‘storage’)
SERVER_MODE = False
13. Чтобы запустить средство управления pgAdmin4, вызовите команду:
14. Теперь, перейдите в свой браузер и введите адрес указанный ниже.
Вам будет предложено установить мастер-пароль, поэтому установите надежный пароль и нажмите кнопку «ОК«.
Установить Пароль PgAdmin4
15. Чтобы упростить задачу, вы можете создать алиас (псевдоним) в файле
/.bashrc, как показано ниже.
16. Затем обновите файл bashrc.
17. Ну и теперь наконец вы можете запустить инструмент управления pgAdmin4, просто вызвав команду startpg.
Еще раз зайдите в свой браузер и войдите в интерфейс PgAdmin4. На этом установка pgAdmin4 в Linux Mint завершается.
Источник
Installing pgAdmin 4 on Linux Mint 20 (ulyana)
Jul 11, 2020 · 4 min read
What Exactly is pgAdmin?
pgAdmin is a management tool for PostgreSQL and derivative relational databases such as EnterpriseDB’s EDB Advanced Server. It may be run either as a web or desktop application.
pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
source(pgadmin.org)
As at the time of writing this, PgAdmin 4.23 is the latest version and from the official download page, this can be installed using the apt-get install method, though for now only Ubuntu 16.04 (Xenial), 18.04 (Bionic), 19.10 (Eoan), 20.04 (Focal) are officially available through the apt-get method, that leaves a headache for the users of the Latest Linux mint (version codename ulyana).
I’M SURE THE PGADMIN TEAM IS WORKING ON ADDING apt-get support for ulyana (it’s still relatively new) but this is a workaround to get the latest version of pgAdmin4
This method also works for any Linux version
Follow the following steps to install pgAdmin4 on your Linux/Ubuntu machine
I’ve seen this on so many installation guides and guess what ill ask you to do first, UPDATE.
2. install PostgreSQL (if you don’t have it installed already)
Create the username and password for PostgreSQL database. Type the following command in the terminal to add login credentials for the user, Postgres
3. I nstall the required packages
4. C r eate a virtual environment
Run the following commands navigate to your home directory, create a new folder named pgAdmin4 and create the virtual environment.
5. Activate the virtual environment
6. Fetch and install the latest version of pgaAdmin4 using pip install
7. Configure and run pgAdmin 4
Create a new file named config_local.py in lib/python3.8/site-packages/pgadmin4
Then add this to the file
8. Test the installation by running the command below
This should start pgAdmin4
9. Create an alias in your
A brief explanation of the above snippet
10. You can easily start The Pgadmin using the “startPg” command
we are good to go
NB : Using virtual environment isn’t necessary. You can install pgadmin4 as your local package (e.g. at
/.local/lib/python3.8/site-packages/pgadmin4) instead of installing in a virtual environment. BUT IT IS ADVISABLE TO USE A VIRTUAL ENVIRONMENT
Источник
How to Install PostgreSQL with pgAdmin4 on Linux Mint 20
pgAdmin is an open-source feature-rich, frontend management tool that allows you to easily administer and manage your PostgreSQL relational database from a web browser.
It provides an easy-to-use user interface that simplifies the creation and monitoring of databases and database objects. PgAdmin 4 is an improvement of the earlier pgAdmin tool and is available for Linux, Windows, macOS systems, and even a Docker container.
In this tutorial, you will learn how to install PostgreSQL with pgAdmin4 on Linux Mint 20.
Step 1: Install PostgreSQL Database on Linux Mint
1. To start off, launch your terminal and update your packages using the apt package manager as shown.
Once the update is complete, proceed to the next step.
Since pgAdmin4 provides a frontend interface for the management of PostgreSQL database objects, it’s essential to have PostgreSQL installed first.
2. To do this, we are going to install the postgresql package and postgresql-contrib which offers extended features that extend the functionality of PostgreSQL.
Install PostgreSQL on Linux Mint
3. Usually, PostgreSQL starts automatically on boot up. You can confirm this using the command given below:
Check PostgreSQL Status
4. To log in to your PostgreSQL instance, first switch to the postgres user. The Postgres user comes included by default with the installation of PostgreSQL. Then run the psql command as shown.
Connect to PostgreSQL Shell
5. Additionally, you can check if the database server is accepting incoming connections as shown.
Check PostgreSQL Accepting Incoming Connections
Step 2: Install pgAdmin4 on Linux Mint
pgAdmin4 is available for Ubuntu 16.04 and later versions and can easily be installed using the APT package manager. The same cannot support Linux Mint 20 and Pgadmi4 developers are yet to include support that allows users to easily install the frontend management tool using the APT package manager.
6. The only viable option is to install pgAdmin4 from a virtual environment. So first, we will install the prerequisite packages as shown.
Install Prerequisite Packages
7. Next, install the Python virtual environment and associated dependencies.
Install Python Virtual Environment
8. Next, create a directory where you will create a virtual environment.
9. Then create the virtual environment as shown. Here, pgadmin4env is the name of the virtual environment.
Create Virtual Environment for pgAdmim4
10. Once the virtual environment is in place, activate it as shown.
11. Then use the pip tool to install pgadmin4 as shown.
Install PgAdmin4 in Linux Mint
12. Next, create a configuration file config_local.py.
and add the lines below.
Create PgAdmin4 Configuration
13. To start the pgAdmin4 management tool, invoke the command:
Start PgAdmin4 Service
14. Finally, head over to your browser and browse the address shown.
You will be prompted to set the master password, so proceed and set a strong password and click the ‘Ok’ button.
Set PgAdmin4 Password
15. To make things easier, you can create an alias in the
/.bashrc file as shown.
16. Next, update the bashrc file.
17. Finally, you can start the pgAdmin4 management tool by simply invoking the startpg command.
Start PgAdmin4 Tool
Once again head over to your browser and log in to the PgAdmin4 interface. And this concludes the installation of pgAdmin4 on Linux Mint.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник