many icons are grayed in workbench 6.3.6 on ubuntu 16.04 - mysql-workbench

I just installed mysql workbench 6.3.6 on ubuntu 16.04.
When I connect to db, many icons on the top are disabled ( grayed ) and doesn't show any default schemas (such as sys and etc ) on the left
as you see in the figure, so I cannot create db and tables in workbench.
I followed this youtube video, https://www.youtube.com/watch?v=u6p2OU491Ss
and many icons are activated ( not grayed in the video ) in workbench.
I created mytest db manually in command line and icons in both local instance and mytest are grayed in workbench. But I can connect to mysql in command line with username root and password that I reset.
This is because Test connection failed in workbench. don't know why.
FYI, when I reset root password, I used this command:
UPDATE mysql.user SET authentication_string=PASSWORD('newpassword'), plugin='mysql_native_password' WHERE User='root' AND Host='%';

You have no valid connection, that's why the buttons are disabled (and hence shown in gray). Open MySQL Workbench with valid credentials and everything should start working as you expect. The connection test error seems to indicate that your MySQL server is not running.

Related

pgadmin db restriction server property not working

I have a heroku postgres database. On pgadmin i can see over 1,700 databases since they are all on the same host. I have set the server connection settings as provided by heroku and i can see my database highlighted in yellow and can access it normally.
I tried disconnecting from the server than edit the db restriction property in the advanced tab and put in my database name(same one as the maintenance db, and without ''). I press save, i reconnect to the server but i can still see all the databases of the server and all the live data of the entire server. Am i missing something?
DonĀ“t download the latest version of pgadmin 4(v.6.10), instead download the v.6.9
link:
https://www.postgresql.org/ftp/pgadmin/pgadmin4/v6.9/windows/
I believe that latest version is buged when we try to especify a dbname for restriction
uninstall 4(v.6.10) and replace (v.6.9)
i faced the same problem here, but installed (v.6.9) and worked great, and brings me only my database
for pgadmin4 you dont need single quotes ... just write the dbname and then tab
How to hide databases that I am not allowed to access
result-image

Databases in psql Don't Show up in PgAdmin4

I installed Postgres
and followed the instruction. I create a database and logged in by the master password but I don't find the database even the + mark is not shown in the servers. can anyone help, please?
Unlike in pgAdmin3, with pgAdmin4,here you have to manually connect to a running postgres server andyou already have your specific database (DB) created.
So to set the stage, make sure you have the postgres server is running, and that you have created that DB already too.
Notice (in the image) that I CREATE database XYZ and GRANT all privileges to default user postgres. (Note; to work properly with pgAdmin4, you have to create a user called postgres in order to be able to connect with and log in to pgAdmin4.)
Then here are some quick steps to follow:
When within pgAdmin4, right-click the Servers option and select create.
Note:
In the image you'll see (1) next to "Servers" because I have done this process already. Kindly ignore that).
Select "server group" if you have many servers that you want to better manage. For most basic use cases, go ahead and select "server" (like I did).
For either option you select above, you'll get a pop-box to complete the "connection process". I selected "server" which is appropriate for your use case (see image below).
Note:
"name" field is required
As you can see already, enter a name (I went with "postgres" since it's what I was used to by default in pgAdmin3, but you can enter any name).
Notice the "connect now" checkbox is checked by default so as soon as the process is successful, your DB should display in the sidemenu. (This is a key to confirm that you entered the right info). But you can always uncheck this, to connect later.
Now, click connection tab and you see the image below.
The key fields to fill here, to keep it simple, are host name/address and password. Remember to save after entering your info.
Note:
If on connecting to local machine, localhost or http://127.0.0.1 should do. (I did "localhost")
If connecting to a DB instance in the cloud e.g. AWS, enter the endpoint in the host space. Here's more from AWS
A lot of the other fields have the default settings used when installing postgres and pgAdmin.
If you followed the steps above properly, then you should see something like this after you save.
Here's a good guide from the pgAdmin documentation
In case you created your database as template CREATE DATABASE ... IS_TEMPLATE =true, then the database is considered as "system object" and is not shown in the list if PgAdmin4 option "Show system objects?" is set to false.
Try menu File -> Preferences, in the tree find Browser -> Display, and the option is at the bottom.
Another option is to remove the template option:
ALTER DATABASE xxx IS_TEMPLATE = false
and then you will see your database without changing PgAdmin preferences.
I followed the introductory advice from #MwamiTovi but I still did not have an option to create a server as he noted. However, I was able to get my databases to appear by clicking menu option Object -> Register -> Server and type in the information (hostname/address, port) from my associated psql setup.
This was using PG Admin 4.19 on macOS Big Sur.

Why does running a query return 'table_oid' under messages and nothing under Data Output

Running any sort of query on pgAdmin 4 just returns a 'table_oid' under messages.
I am able to get the necessary data when running the query from the command line, for example
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'));
I understand that table_oid refers to the object id of the table, but I have no idea how to access it.
Pardon me please if it is a simple question, but I am unable to find any resources online
Expected:
010300000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40
Actual:
table_oid
From pgAdmin 4 project tracker:
Temporary solution until next release and tested in my ubuntu 18.04 machine:
Replace these two 2 files:
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/__init_*_py
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/command.py
Link to files:
__init_*_.py
command.py
Note:
The first file's name is __init_*_py, without the *.
Try Squirrel SQL - Universal SQL Client. It's an extremely useful SQL client. I use it to access SQL Server, PostgreSQL, MySQL, Access. It's not as good looking as pgAdmin4.
Install JAVA first, if not already installed.
Install Squirrel SQL.
Download the latest PostgreSQL JDBC driver, e.g. postgresql-42.2.6.jar, and put it into a convenient location.
Open/Start Squirrel.
Click the Drivers Tab and scroll down to PostgreSQL. Double click PostgreSQL. A "Change Driver: PostgreSQL" dialog box/window will open.
Click the Extra Class Path tab and click the Add button. Navigate to and choose the PostgreSQL JDBC Driver that was downloaded in step 3. above.
Click the List Drivers button, "org.postgresql.Driver" should appear in the Class Name drop down box.
Click OK.
Setup PostgreSQL JDBC Driver
The driver should now be setup.
Click the Aliases tab to setup a connection to your database. See my example screenshots.
Setup Database Connection

Eclipse to MySql via SSH proxy connects but can't query without a database qualifier

I'm using Eclipse Juno with the SQL Explorer plugin. I've set up an SSH tunnel for port 3306 via Putty to my production server and have successfully connected to that server's MySql instance. I can view the database's schema as well as getting a preview of a table's data. When I try to execute a basic SELECT query, without a database qualifier on the table, Eclipse gives me a NullPointerException with no additional information. However, if I include the database qualifier, it works.
The database selector in Eclipse/SQL Explorer is set correctly and everything works as expected if I'm not running over the SSH tunnel (e.g. locally or a direct remote connection).
Is there something that I'm overlooking?
The problem was caused by a bug in the SQL Explorer plugin (see http://sourceforge.net/p/eclipsesql/discussion/450662/thread/f1e73461). The symptom was a red herring. The NPE would occur when the plugin tried to write to its history file. Clearing the history file resolved the problem.

MySQL Workbench GUI connection failure

I'm using MySQL Workbench to interface with a remote database. When I configure the settings for the connection and click 'Test Connection', it displays a success dialog. Furthermore, if I right click the connection and select 'Start Command Line Client', everything is golden.
However, when I click the connection to use the GUI it displays a failure dialog 'Cannot Connect to Database Server'.
How might I resolve this issue?
Can you execute following commands using MySQL command line:
SHOW CREATE TABLE mysql.user;
SHOW VARIABLES LIKE '%char%';
If you cannot execute those without any error, that means you have a permission problem with your user.
May be your problem is the same problem mentioned here http://bugs.mysql.com/bug.php?id=50024