?
Solved

Connect to MySQL via MySQLWorkBench or SQL Developer

Posted on 2011-03-18
11
Medium Priority
?
1,686 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 2

Expert Comment

by:ramkihardy
ID: 35170136
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 84

Expert Comment

by:Dave Baldwin
ID: 35170359
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
ID: 35172210
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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35172256
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
ID: 35172635
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
 

Author Comment

by:toooki
ID: 35172647
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 84

Expert Comment

by:Dave Baldwin
ID: 35172720
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
ID: 35175738
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 84

Accepted Solution

by:
Dave Baldwin earned 1900 total points
ID: 35176311
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
ID: 35178086
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 84

Expert Comment

by:Dave Baldwin
ID: 35178093
Glad you got it working.  Thanks for the points.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this article, we’ll look at how to deploy ProxySQL.
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

765 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