Solved

Connect to MySQL via MySQLWorkBench or SQL Developer

Posted on 2011-03-18
11
1,589 Views
Last Modified: 2012-05-11
I need to update a production application written in Perl. The Perl program connects to a MySQL database via this command:
my $dbh = DBI->connect("DBI:mysql:database=www;host=localhost", "www", "myPWD", {'RaiseError' => 1});

I copied the above line from a working application. I only changed the password value to myPWD. I want to logon to the MySQL server via MySQL client but I cannot:

I logon to the server (Sun Solaris 10) where the Perl code resides and there I become root:
# id
uid=0(root) gid=1(other)
#which mysql
/usr/misc/bin/mysql
#/usr/misc/bin/mysql myPWD -u www -pmyPWD www
I can connect to the database.


But when I use MySQL WorkBench I cannot connect -- I get attached error.

Now I try to connect to the MySQL database via SQL developer. There I can connect but the window does not let me choose the database name.
I can see the tables under the database name "www" but I cannot query -- error shows "No Database selected".
I attached snap. How could I connect to the database via MySQL Workbench or via SQL developer and query successfully? MySQLworkBench Error SQL developer error
0
Comment
Question by:toooki
  • 5
  • 5
11 Comments
 
LVL 2

Expert Comment

by:ramkihardy
Comment Utility
Use this command before the "Select * from groups query"
Use Database name;
the write your query
Select * from groups query;
Hope this helps.....
let me know if you want any help..further
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
You could look for an old version of MySQL Workbench.  Workbench 5.0.30 is still available from MySQL http://dev.mysql.com/downloads/workbench/5.1.html#downloads .  You will probably have to select it from the links and dropdowns.

phpmyadmin is probably one of the most widely used ways to manage MySQL databases.  It does require a server to run PHP but WAMP and XAMPP are easy to install on Windows.
0
 

Author Comment

by:toooki
Comment Utility
Thank you.
My current MySQLWorkBench version is 5.2.30 CE.
If I download 5.0.30 it will erase the 5.2.30 CE version. I use MySQLWorkBench to connect to other SQL server databases too. So I do not know how I could install another version on the server.

Otherwise can I install phpmyadmin on a Solaris 10 server?

use www;
The above command work when I try from sql client on sql prompt on my windows XP PC.
sql>use www;
But I wanted to use this on Oracle Developer IDE.
Very strangely unlike other MySQL database -- this does not let me select the database name when I create the connection to the MySQL database from the Oracle Developer.  I attached the screen-shot -- it does not show up in the pull-down items.
If I type in use www
I get error -- I attached the screen-shot. Oracle SQL developer New connection error
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
As noted in your first error message, the MySQL database you're trying to connect to is 'pre-4.1.1'.  '4.1.1' is the point where they changed some access procedures.  MySQL doesn't support anything before MySQL 5 now.  In addition, PHP 5.3 doesn't either because it uses the current 'connector' from MySQL for it's functions.

This page http://dev.mysql.com/doc/refman/5.5/en/old-client.html talks about the change and suggests a way to 'fix' it.  Some people have found that it disables the old MySQL server to do so so be careful.
0
 

Author Comment

by:toooki
Comment Utility
Thank you.
I installed MySQLWorkbench on a separate Windows PC. This time I installed version 5.0.30.
But this version does not have an option to connect to a database, which is strange.

I attached screen-shots.
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

by:toooki
Comment Utility
Thank you.
I installed MySQLWorkbench Version 5.0.30 on a different Windows PC but very strange -- it does not have option to connect to a database.
Under the database tab I do not see option for new connection.
I attached screen-shots. screen screen
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Turns out that I have a very old version of the MYSQL GUI Tools (version 1.28!) and it will connect to a MySQL 4.0.25 database I use.  The connections are setup in MySQL Administrator.  I think that should have been part of the installation for MySQL Workbench.  So open up MySQL Administrator and it should ask you for the connection info.
0
 

Author Comment

by:toooki
Comment Utility
Thank you.
For the "old version of the MYSQL GUI Tools" is it the MySQLworkbench or some other IDE? For MySQLworkbench 5.0.30 is the oldest version that I can download...
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 475 total points
Comment Utility
I went looking and couldn't find the file I downloaded or an old version of the MySQL GUI Tools anywhere.  I'm still looking.  I hardly ever get rid of the programs I download.
0
 

Author Comment

by:toooki
Comment Utility
Thank you.
I think I should give up on the IDE option. I could connect to the mySQL database via MySQL client. So I am ok. Thank you for all the information.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Glad you got it working.  Thanks for the points.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now