Solved

Connect to MySQL via MySQLWorkBench or SQL Developer

Posted on 2011-03-18
11
1,632 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
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: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
insert row field data graphically 4 28
AWS EC2 & RDS Instance 5 50
SYbase 4 36
T-SQL: New to using transactions 9 46
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

808 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