SELECT, INNER JOIN getting all ancestors of a term

2005-04-06 Thread l'eau
I tried the query defined in the Go Example queries:
and added some filtering on t.term_type, t.is_root and t.is_obsolete

Finding all ancestors of a term:

SELECT p.*
FROM
 graph_path 
  INNER JOIN
 term AS t ON (t.id = graph_path.term2_id
and t.term_type=biological_process)
  INNER JOIN
 term AS p ON (p.id = graph_path.term1_id
and t.term_type=biological_process)
WHERE t.name = 'DNA Helicase activity';
I added to the where clause: 
and t.is_root=0 and t.is_obsolete=0;

I still get in the result:
 some terms refering to the root name=biological_process or 
name=physiological_process. Also these are duplicated rows.

 Should not this query reduce the result to the biological process terms only 
with no duplicates?

Thank you
Laurie

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



JDBC driver problem with sql LIMIT

2005-03-30 Thread l'eau
 
Using MySql Connect/J (mysql-connector-java-3.1.7.tar)
on Linux Fedora 2.

I use a Statement object and do the following query:

String myquery = SELECT * FROM term WHERE name REGEXP (\'+ name 
+\') and term_type=\'+ ontology +\'  LIMIT 20;  
table term has 6 columns.

MySql connect/J use 700mB to retrieve hundreds of rows when it should retrieve 
only 20. Actually it crashes with:
Exception in thread AWT-EventQueue-0 java.lang.OutOfMemoryError: Java heap 
space
Exception on Toolkit thread: java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

Is LIMIT supported with the JDBC driver?
thank you everygody
Laurie

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql not starting at boot

2005-03-30 Thread l'eau

To have mysql to start at boot you need to inform the inetd (daemon)  that 
mysql should be launched at one of the 6 levels:

Use chkconfig to have mysql start in one of the level (2,3,4,5,6)
5 being X windows.

There are two ways to check that mysql will be loaded:
- 1 - by checking the file in /etc/rc.d/rcX.d (X being a number: 1,2,3,4,5,6)
- 2 - by executing chkconfig

execute the following to see if mysql runs at any level
 /sbin/chkconfig --list | grep mysql 
you should see at which level mysql is running.
mysql   0:off   1:off   2:off  3:off  4:off  5:off  6:off

If it is all off then execute:
 /sbin/chkconfig --level 2345 mysql on 
(this will make sure that mysql runs at level 2, 3, 4 and 5)

On my machine (Fedora 2) it runs at 2,3,4 and 5.

Once you have it run at a level you can verify it by looking at rcX.d (X being 
a level):
for example to check that it runs at level 4:
go to /etc/rc.d/rc4.d/
and look at a file named ...mysql 
S20mysql
(S means it will be picked up by the inetd daemon)
K30mysql
(K means Kill and mysql wont start)

good luck
Laurie

On Wednesday 30 March 2005 09:26 pm, Mark Sargent wrote:
 Hi All,

 below is my /etc/init.d/mysql content, but, mysql is not starting at
 boot on Fedora3. Have I missed something fundamental.? I need mysql to
 start at boot for snort to connect to it. Currently, snort gives an
 error stating it can't connect. Cheers.

 Mark Sargent.

 [EMAIL PROTECTED] ~]# cat /etc/init.d/mysql
 #!/bin/sh
 # Copyright Abandoned 1996 TCX DataKonsult AB  Monty Program KB  Detron
 HB # This file is public domain and comes with NO WARRANTY of any kind

 # MySQL daemon start/stop script.

 # Usually this is put in /etc/init.d (at least on machines SYSV R4 based
 # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
 # When this is done the mysql server will be started when the machine is
 # started and shut down when the systems goes down.

 # Comments to support chkconfig on RedHat Linux
 # chkconfig: 2345 90 20
 # description: A very fast and reliable SQL database engine.

 # Comments to support LSB init script conventions
 ### BEGIN INIT INFO
 # Provides: mysql
 # Required-Start: $local_fs $network $remote_fs
 # Required-Stop: $local_fs $network $remote_fs
 # Default-Start:  2 3 4 5
 # Default-Stop: 0 1 6
 # Short-Description: start and stop MySQL
 # Description: MySQL is a very fast and reliable SQL database engine.
 ### END INIT INFO

 # If you install MySQL on some other places than /usr/local/mysql, then you
 # have to do one of the following things for this script to work:
 #
 # - Run this script from within the MySQL installation directory
 # - Create a /etc/my.cnf file with the following information:
 #   [mysqld]
 #   basedir=path-to-mysql-installation-directory
 # - Add the above to any other configuration file (for example ~/.my.ini)
 #   and copy my_print_defaults to /usr/bin
 # - Add the path to the mysql-installation-directory to the basedir
 variable #   below.
 #
 # If you want to affect other MySQL variables, you should make your changes
 # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.

 basedir=

 # The following variables are only set for letting mysql.server find
 things.

 # Set some defaults
 datadir=/usr/local/mysql/data
 pid_file=
 if test -z $basedir
 then
   basedir=/usr/local/mysql
   bindir=./bin
 else
   bindir=$basedir/bin
 fi

 PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
 export PATH

 mode=$1# start or stop

 case `echo testing\c`,`echo -n testing` in
 *c*,-n*) echo_n=   echo_c= ;;
 *c*,*)   echo_n=-n echo_c= ;;
 *)   echo_n=   echo_c='\c' ;;
 esac

 parse_arguments() {
   for arg do
 case $arg in
   --basedir=*)  basedir=`echo $arg | sed -e 's/^[^=]*=//'` ;;
   --datadir=*)  datadir=`echo $arg | sed -e 's/^[^=]*=//'` ;;
   --pid-file=*) pid_file=`echo $arg | sed -e 's/^[^=]*=//'` ;;
 esac
   done
 }

 # Get arguments from the my.cnf file,
 # groups [mysqld] [mysql_server] and [mysql.server]
 if test -x ./bin/my_print_defaults
 then
   print_defaults=./bin/my_print_defaults
 elif test -x $bindir/my_print_defaults
 then
   print_defaults=$bindir/my_print_defaults
 elif test -x $bindir/mysql_print_defaults
 then
   print_defaults=$bindir/mysql_print_defaults
 else
   # Try to find basedir in /etc/my.cnf
   conf=/etc/my.cnf
   print_defaults=
   if test -r $conf
   then
 subpat='^[^=]*basedir[^=]*=\(.*\)$'
 dirs=`sed -e /$subpat/!d -e 's//\1/' $conf`
 for d in $dirs
 do
   d=`echo $d | sed -e 's/[  ]//g'`
   if test -x $d/bin/my_print_defaults
   then
 print_defaults=$d/bin/my_print_defaults
 break
   fi
   if test -x $d/bin/mysql_print_defaults
   then
 print_defaults=$d/bin/mysql_print_defaults
 break
   fi
 done
   fi

   # Hope it's in the PATH ... but I doubt it
   test -z $print_defaults  print_defaults=my_print_defaults
 fi

 #
 # Test if someone changed datadir;  In 

show databases;

2005-03-12 Thread l'eau

I am on linux Fedora 2 with mysqld running as a daemon and the service mysql 
running (/etc/rc.d/init.d/).

I have two shell sessions (mysql client) running one with root and the other 
with a user.
I did (as root) : grant all privileges on mydb to [EMAIL PROTECTED];
in the root session the show databases; return 3 databases (test, mysql, mydb)
in the user session the show databases; return 1 database (test)


what is going on?

thanks
laurie

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]