Archive for the ‘sql’ Category.

Connecting to MySQL across Domain and workgroup

I have a mysql running in a box connected to a domain. I tried to connect it from a laptop not connected to the same domain. It is running as a workgroup. Though the parameters are correct, I got an error ‘Error Code: 1045′

An error occured while establishing the connection.
 Type: java.sql.SQLException   Error Code: 1045   SQL State: 28000
 Message:
 Access denied for user 'root'@'192.168.10.74' (using password: NO)

But I am able to connect to Oracle DB which is running in the same environment. Googling fetch me some results saying we need to give permissions suitable for the situation. I ran the following query which solved the connectivity issue.

GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'your_root_password';

Installing Oracle 10g Express edition in Mandriva 2009

Hi,

This is to share the screenshot of the oracle installation in my mandriva 2009 (Free). The installation is very simple. Download the oracle installation jar from oracle.com. It has only one dependency, considering mandriva 2009, which is libaio.jar. See whether it is coming with Mandriva, or else download from the web. thats it. then install the RPMs.

Once RPMs are installed, database need to be configured. Issue the following command to configure the database.

/etc/init.d/oracle-xe configure

This will take you to a text wizard asking the system username, password etc and complete your installation process. See the screenshot below.

Oracle installation screenshot

Thats all!

Try to login to your oracle server with the web interface
http://localhost:8080/apex
ofcourse you have the option to change the port also.

oracle web interface

happy dbing!

Oracle listener configuration after changing machine name

I was not able to start my oracle instance today. The start and stop server scripts dint show any error, instead they said server started/stopped without any problem. Windows System event log had a error entry saying “The OracleXETNSListener service terminated unexpectedly. It has done this 8 time(s).”Oracle listener issue screenshotwhen I run lsnrctl start I found the issue.D:\Documents and Settings\pandian> lsnrctl startLSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 23-NOV-2008 01:08:40Copyright (c) 1991, 2005, Oracle. All rights reserved.Starting tnslsnr: please wait...TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - ProductionSystem parameter file is D:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.oraLog messages written to D:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.logListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=acs-59abc34f442)(PORT=1521)))TNS-12545: Connect failed because target host or object does not existTNS-12560: TNS:protocol adapter errorTNS-00515: Connect failed because target host or object does not exist32-bit Windows Error: 1001: Unknown errorListener failed to start. See the error message(s) above...There is the issue. I renamed my host name. So listener is not able to start. I edited the listener.ora found at oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN folder. I changed the host to localhost. It is working now! :)

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

kuttikaranam

Today I had a new install of Mandriva 2008 linux. I wrote a java code to test the mysql connectivity. It ended with the following exception.

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.

Alas, deeper google search gives me a solution that told about the mysql connectivity parameter in /etc/my.cnf

skip-networking

This parameter has been added for some security related reasons. Really I dont know what it is. I just removed that line, which solved this issue.

Oracle 10g Express edition

DB legends are releasing their edition as a miniature, previously MS-SQL came with their own mini server. MySQL is always small doing great jobs. and Here I am giving Oracle 10g Express edition. It is cool, very easy to install and get it running. Add to its great things, It offers a cool web interface (see the screenshot below), like Linux admin tools :) . Oracle says it is free to develop, deploy, and distribute. Those who are interested can get their copies at

http://www.oracle.com/technology/products/database/xe/index.html

Oracle web admin screenshot