Solved

Connect to MySQL via MySQLWorkBench or SQL Developer

Posted on 2011-03-18
11
1,659 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 83

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 83

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 83

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 83

Accepted Solution

by:
Dave Baldwin earned 475 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 83

Expert Comment

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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 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