MySQL Workbench GUI connection failure - mysql-workbench

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

Related

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.

Not able to see Tables in SQL Developer after connecting

I am new to SQL Developer.I am using 4.0.3.16.84-x64 version.After entering the connection details test connection is showing success and I am able to login successfully but when I click on the expand button beside the connection name no tables are appearing. Note with same connection parameters I am able to connect and successfully see the tables in my friend's machine.

many icons are grayed in workbench 6.3.6 on ubuntu 16.04

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.

Mysql Workbench error 1142 "Error querying security information" on Data Export

yesterday I updated my Workbench to the latest version available, the 6.3.6 build 511 CE on Windows 10.
Now I'm trying to make a dump of a remote database via the "Data Export" feature, which has always worked.
But, as soon as I click the "Start Export" button, I get this error:
Unhandled exception: Error querying security information: Error
executing 'SELECT * FROM mysql.user WHERE user = '[username]' and
Host = '[host]' ORDER BY User, Host'
SELECT command denied to user '[username]'#'[host]' for table 'user'
SQL Error: 1142
I know that I don't have the permissions to read that table, but why is that needed to perform a data export?
I've tried to check the force option (Continue even if we get an sql-error) but it's still not working.
Is this a Workbench bug? Or is there any way to avoid this query?
I had this exact same issue. The solution provided in this thread (same as the_nuts answer) is to uninstall 6.3.6 and install 6.3.4 from the archived versions: https://downloads.mysql.com/archives/workbench/
Update as of 13th June 2016
This bug has now been fixed
Download 6.3.7 (or later if available) from here
Found, this is indeed a bug of the version 6.3.6:
MySQL Bugs: #79807: Workbench Data Export: Unhandled exception: Error querying security information
MySQL Workbench has the correct behavior. If you are using a user other than 'root' MySQL Workbench will display that alert. However, if you setup your access to the server and database as root you will not run into problems exporting/importing because you have the right access to do so.

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.