pgAdmin III (pgadmin3_92.x86_64 0:1.16.1-1.rhel6 ) won't start - postgresql

OS on which I've isntalled pgAdmin: Centos 6.3
Postgresql 9.2 is installed on another machine (not sure if this matters)
Have installed pgadmin3_92 via postgresql repo.
When I go: Applications > Programming > pgAdminIII, and select, nothing happens.
When I enter pgadmin3_92 into the terminal I get
pgadmin3_92: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
I've tried a Google search for this error and it came back with no results. I'm only new with Linux/Centos so I've reached the limit of what to do next to figure out how to get pgAdminIII working.
Any ideas on what to look for/do next?

The error is caused by Centos not being able to find the shared libraries to run the application.
My pgadmin3 library files are installed at: /usr/pgsql-9.2/lib
I ran ldd pgadmin3 as per hints here, this confirmed that the shared library could not be found to run pgadmin.
Also on the same link it shows to change to root user: su - root, and then create a .conf file that points Centos to where the libraries are for pgadmin3. The command to create this file is:
echo /usr/pgsql-9.2/lib > /etc/ld.so.conf.d/pgsql-9.2.conf
For someone else this would be:
echo <location of pgadmin3 libraries> > /etc/ld.so.conf.d/pgsql-9.2.conf
I then ran: cat /etc/ld.so.conf.d/pgsql-9.2.conf to confirm the file had been created and the location of the libraries had been written to the file.
I then ran the following to ensure Centos was refreshed with this new configuration info:
/sbin/ldconfig
I was able to run pgadmin3 after this.

yum install postgresql92
If it is not enough then
yum install postgresql92-libs

Related

Postgresql 12 doesn´t find PostGIS extension on CentOS 8

I´m trying to get PostGIS working, but it seems that Postgresql doesn´t find the extension. My server is running on CentOS 8, the Postgresql is version 12. I installed Postgresql 12 first via dnf module enable postgresql:12 etc..
Afterwards I installed PostGIS and followed the description on the PostGIS website (https://people.planetpostgresql.org/devrim/index.php?/archives/102-Installing-PostGIS-3.0-and-PostgreSQL-12-on-CentOS-8.html). But when I try to run CREATE EXTENSION postgis; I get the error ERROR: could not access file "$libdir/postgis-3": No such file or directory SQL state: 58P01 I figured out that the needed files reside in a subdirectory "bitcode". Therefore I tried to symlink the content in the $libdir directory above - but didn´t help. Even copying them in the directory didn´t - same error. What am I missing?
Thank you and best regards,
Goetz
You have a mix of packages installed: Some from the CentOS distribution, some from the PostgreSQL site. That will lead to trouble.
Uninstall the PostgreSQL packages that do not have PGDG in them and make sure to disable them as shown in the link you show. Then install the PGDG packages for PostGIS

Creating Postgis extension: "ERROR: could not open extension control file"

I am getting the following error when I run create extension postgis;
ERROR: could not open extension control file "/Library/PostgreSQL/9.6/share/postgresql/extension/postgis.control": No such file or directory
I am using Postgres 9.6.3 and PostGIS 2.3.2 installed using Homebrew on OS X El Capitan.
mdfind -name postgis.control shows:
/usr/local/Cellar/postgis/2.3.2/share/postgresql/extension/postgis.control
brew info postgis shows:
PostGIS extension modules installed to:
/usr/local/share/postgresql/extension
When I start the Postgres console I see:
psql (9.6.3, server 9.6.1)
I read a similar question, PostGIS Homebrew installation referencing an old path?, and tried to reload postgresql using the commands given in the top answer, but I am still seeing psql (9.6.3, server 9.6.1). Also, I believe my issue is different because it's looking for the extension control file in /Library and not /usr/local/Cellar.
Any help would be appreciated.
When you try to install postgis it install latest version of postgresql along with it as dependency.
So if you installed postgres#V (where V is user desired version )
brew install postgresql#V
later you run this command
brew install postgis
it will install postgres10.1 or whatever is latest.
So after that if run
create extension postgis;
In postgresql#V it will try to check its extension directory and it won't find postgis.control in extension directory as this postgis is installed in extension folder of postgresql version that is installed with that.
To solve this problem, you have to create a symlink from given installation of postgis to the desired postgresql#V
This example for postgresql#9.6
ln -s /usr/local/share/postgresql/extension/postgis* /usr/local/Cellar/postgresql#9.6/9.6.6/share/postgresql#9.6/extension/
ln -s /usr/local/lib/postgresql/postgis-2.3.so /usr/local/Cellar/postgresql#9.6/9.6.6/lib/postgis-2.3
ln -s /usr/local/lib/postgresql/rtpostgis-2.3.so /usr/local/Cellar/postgresql#9.6/9.6.6/lib/
before running these commands, please check postgresql version and file path in your system
Thanks this gist for help.
I had a similar problem with full details here. When the server is mentioned in your Postgres console, it means that you're referencing an older codebase. Stop that server and launch the correct server with the following commands.
$ brew services list
That will give you a list of database servers that are running.
$ brew services stop postgresql#<older-version>
$ brew services start postgresql

MySQL Workbench Closes Unexpectedly

I'm using CentOS 6.4, and did
sudo yum install mysql-workbench-community.x86_64
That installed MySQL workbench version 6.1
When I launch the application it lists MySQL Connections, and has a box for Local instance 3306.
When I double click that box the app just closes. WTH?
edit: it's printing this on the console
/usr/libexec/mysql-workbench/mysql-workbench-bin: symbol lookup error: /usr/lib64/mysql-workbench/libwbscintilla.so: undefined symbol: gtk_widget_get_realized
If you've got the same issue like me with Workbench unexpectedly crashing it's easy to resolve:
Edit -> Preferences -> tab "general" and check "Force use of software based rendering for EER diagrams"
At least it's worth a try!
I too was experiencing same problem (on CentOS 6.4). I followed what they concluded on this bug report file. I installed the Workbench 6.0.9 release and the problem is gone.
If you've got the same issue like me with Workbench unexpectedly crashing while opening previous session with tables then just clean up sql_workspaces folder with their sub-directories:
rm -rf ~/.mysql/workbench/sql_workspaces/*
Unfortunately I have the repetition of this event every time so I created the alias in my ~/.bashrc (pro-)file:
alias fix_workbench='rm -rf /home/user/.mysql/workbench/sql_workspaces/*'
P.S.: My MySQL Workbench's version is: 8.0.12. The debug log is too long, including Register/Memory dumps and Backtrace.
As plan B you can also use dbeaver. It works on all OS.
https://dbeaver.io/download/
You better read what platforms are supported by MySQL Workbench: http://www.mysql.com/support/supportedplatforms/workbench.html. The Linux world is so shattered, it's very difficult to support all flavours. And of course always my own is certainly one that should be amongst the supported platforms...
Had same issue CentOS 6.4 :
/usr/libexec/mysql-workbench/mysql-workbench-bin: symbol lookup error: /usr/lib64/mysql-workbench/libwbscintilla.so: undefined symbol: gtk_widget_get_realized
Installed gtk2 devel libraries.
yum install gtk2-devel
Problem solved.
Thanks
Prasad
Centos6.8, Mysql80, Mysqlworkbench8.0.17
I have encountered same problem。 tried to install other version, but not worked; tried to install gtk2, not worked as well. Finally, I thought maybe the version was not correspond, so I install gtk3, it's worked.
What worked for me were very simple steps:
Downloaded a previous version of MySQL Workbench just in case
If it still shuts down when opening the app then verify that there is no app using mysql (for example a website you are building or whatever project you are working on) Stop them all
Do not open the workbench and stop the mysql server in the command line:
sudo service mysql stop
Now with mysql stopped open MySQL Workbench and open any connection
Once inside, MySQL should obviously not be running so now:
sudo service mysql start
Voila!

pecl instal ibm_db2 fails

I need to install ibm_db2 extension for making php connection with db2. So I have used pecl. But it produces error.
$ pecl install ibm_db2
When I run this, the below error occurs.
.....
checking in /home/db2inst1/sqllib/lib64...
checking in /home/db2inst1/sqllib/lib32... found
checking for DB2 CLI include files in default path... checking in /home/db2inst1/sqllib... not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/pear/temp/ibm_db2/configure --with-IBM_DB2=/home/db2inst1/sqllib' failed
Please help.
download ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz from ibm.com
untar the file into: /opt/ibm/
enter command > pecl install ibm_db2
When prompted for DB2 Installation Directory, use: /opt/ibm/odbc_cli/clidriver/
You need the DB2 headers to build the ibm_db2 PHP extension. They are included in the IBM Data Server Driver for ODBC and CLI.
before install ibm_db2, you have install expc, in the folder uncompress execute the script db2_install with root user: # ./db2_install
It asks for the installation path (e /opt/ibm/db2)
then install ibm_db2
Install a DB2 instance (On Ubuntu due to following instructions: http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html) This will work also on newer systems.
After that run the following command:
pecl install ibm_db2
When prompted type:
/opt/ibm/dbs/V9.7/
and confirm the installation directory
The error is because in the path /home/db2inst1/sqllib not found the include folder.
you must download db2exc_974_LNX_x86_64.tar.gz, uncompress it (e. /otp/ibm/db2)
then install pecl install ibm_db2
DB2 Installation Directory? use this : /opt/ibm/db2
Check also the first comment on PHP manual by Jean Ferreira.
link
You need the APPLICATION DEVELOPMENT TOOLS when you install the client you should have the option to install them.
Check your /home/db2inst1/sqllib/include folder you'll see that you only have asn.h, a boatload of files is missing when you don't have the development tools installed.
Then use /home/db2inst1/sqllib as your install directory.
I lacked the APPLICATION_DEVELOPMENT_TOOLS in my DB2 installation (confirmed by only having asn.h in my includes folder)
To install the APPLICATION_DEVELOPMENT_TOOLS into an existing DB2 installation, follow these instructions
Check your product information. You will need this information later.
db2ls -p -q -b /opt/ibm/db2/V10.5
Download the appropriate Universal Fix Pack from IBM:
https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~Information%2BManagement&product=ibm/Information+Management/DB2&release=All&platform=Linux+64-bit,x86_64&function=textSearch&text=universal
Be sure to find the matching FixPack version (from the step above) and the correct architecture.
Save the file to /opt/ibm/fixpack
Gunzip/Tar the file
cd /opt/ibm/fixpack
gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
tar xvf /top/ibm/fixpack/downloaded_pack.tar
Create a response file /opt/ibm/fixpack/devtools.resp like this.
Replace the PROD value with the Product Response File ID
Replace the FILE value with the DB2 installation folder
PROD = DB2_SERVER_EDITION
FILE = /opt/ibm/db2/V10.5
LIC_AGREEMENT = ACCEPT
INSTALL_TYPE = CUSTOM
COMP = APPLICATION_DEVELOPMENT_TOOLS
Stop DB2 with db2stop or db2stop force
Run db2setup with the response code
cd /opt/ibm/fixpack/universal/
./db2setup -r /opt/ibm/fixpack/devtools.resp
Start DB2 with dbstart
When you are done, run pecl install ibm_db2
Use /home/db2inst1/sqllib as your install directory.
Original instructions were found here to install them into an existing DB2 installation (I used the 3rd option):
http://db2commerce.com/2014/02/11/installing-a-db2-component-after-the-rest-of-db2-is-installed/
I got solution for the above issue.
Need to select Custom Install while installing db2. So I just uninstalled and reinstalled DB2.
After that It works fine for me. Thanks everyone :)

Where do I get libpq source?

I want to write application which uses Postgresql as DBMS.
To write client application do I need libpq library and header files?
If yes where I would get libpq library and header files.
Libpq is included in the full PostgreSQL source code. You can use just libpq without the rest of PostgreSQL, but must download the full package.
You can download it from the PostgreSQL Downloads page.
Once you extract the full package it is inside src\interfaces\libpq.
The PostgreSQL installation guide details how to install only the client libraries in the Installation section, under Client-only installation.
Libpq documentation is also available.
In postgresql sources, src\interfaces\libpq.
And yes, it is possible to compile only the libpq.
get the lipq from repo, {for debian} :
sudo apt-get install libpq-dev
I was also facing this issue but didn't got a clear answer:
This issue clearly states that while installing diesel-cli system is not able to locate libpq.lib
First of all you should have a Postgres installed on your machine.
Also diesel require visual c++, thus download and install it if not already, the size of setup will be ~5gb.
Once above installations are done you need to setup environment variables:
In my case path of Postgres installation is C:\Program Files\PostgreSQL thus add 2 environment variable path under User variables add new in Path where your libpq.lib is located in my case it is available in both C:\Program Files\PostgreSQL\12\lib and C:\Program Files\PostgreSQL\12\bin
Once this is added create one more environment variable PQ_LIB_DIR and set path as shown below
Note: Once done re-trigger the installation command in a new cmd window
Source: pq-sys and github-solution
For Windows users, it's in (version may be different)
C:\Program Files\PostgreSQL\11\lib
There you find libpq.lib. Provide this directory to Linker input.
Don't forget to include C:\Program Files\PostgreSQL\11\include directory for include directories.
I fix this problem reccently. This is a solution if you don't want to install Postgres in you windows.
At first, you need download Postgres Binaries. The version I download is 13.6, but it's seems like any version is fine.
Unzip the zip file.Copy libpq.lib from pgsql\lib to shomewhere like C:\Program Files\Postgres\lib.
Execute the following command in cmd window.
setx PQ_LIB_DIR "{where_you_copy_to}"
Open a new cmd windows and install diesel_cli
cargo install diesel_cli --no-default-features --features postgres
In linux vertify you get the libpq.
1st, there is an app: pg_config: https://www.postgresql.org/docs/current/app-pgconfig.html
after you found out the pg_config absolute bin path.(if you installed multi version of postgressql) Then You can get
--includedir
Print the location of C header files of the client interfaces.
--libdir
Print the location of object code libraries.
Then try to compile/build some example code: https://www.postgresql.org/docs/current/libpq-example.html
Some common failure example: https://www.postgresql.org/docs/current/libpq-build.html
You can install Postgres locally from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads but select only "Command line tools" for install.
After that, you can found libpq.dll in C:\Program Files\PostgreSQL\15\bin