discovery of functional dependencies from data

2013-10-07 Thread javad bakhshi
Hello everyone,

I was wondering if anyone could provide me with some sort of code for 
discovering functional dependencies from data. I can't use wizards that are 
available in DBMS. 

A starting point would be appreciated also.

P.S. What I want is to discover the relations between two columns without 
having any meta data available.

 
Best regards,
Javad Bakhshi,
Computer Science M.Sc
Department of IT, Uppsala University


Unknown database error

2012-10-29 Thread javad bakhshi
Hi,

I get an Unknown database error when I am trying to connect to mysql using C 
API.

I have created the database in mysql prompt as root:

CREATE DATABASE Lr0;

I am pretty sure that the problem is a ownership issue, because when I do
ls -l in my datadir I get:

[javad64@udbl64 data]$ ls -l
total 20532
-rw-rw 1 javad64 mysql   10485760 Oct 26 14:10 ibdata1
-rw-rw 1 javad64 mysql    5242880 Oct 26 14:10 ib_logfile0
-rw-rw 1 javad64 mysql    5242880 Oct 19 15:28 ib_logfile1
drwx-- 2 javad64 javad64 4096 Oct 26 14:35 Lr0
drwx-- 2 javad64 mysql   4096 Oct 22 11:04 mysql
drwx-- 2 javad64 mysql   4096 Oct 22 11:04 test

which shows Lr0 doesn't have mysql ownership.

my question is:
1- Why does this happen? While I am creating the 
database in mysql prompt as root.

2- How can I fix it? I don't have root access in the system I am using
so the chown solution is off table.


 
Best regards,
Javad Bakhshi,
Computer Science M.Sc
Department of IT, Uppsala University


Please do not open the link that was sent to you from my email address

2012-06-09 Thread javad bakhshi
Dear Friends,

There has been some problems with my mail box and some spam emails have been 
sent to you from my email.

Please do not open the link that was sent to you from my email address!!
Sorry for the problem caused.
 
Best regards,
Javad Bakhshi,
Computer Science M.Sc
Department of IT, Uppsala University


Re: ERROR 2013 (HY000): Lost connection to MySQL server during query

2012-03-05 Thread javad bakhshi
Hi,

Still have the same problem and changing connect_timeout didn't help. 
Any other Ideas? Is there even any solution to this?
 
Best regards,
Javad Bakhshi,



 From: mail...@securitylabs.it mail...@securitylabs.it
To: mysql@lists.mysql.com 
Sent: Thursday, March 1, 2012 11:09 AM
Subject: Re: ERROR 2013 (HY000): Lost connection to MySQL server during query
 
Il 01/03/2012 11:03, javad bakhshi ha scritto:
 Hi,
 
 I am trying to load data into my table from a very large file but after some 
 time I get this error:
 
 ERROR 2013 (HY000): Lost connection to MySQL server during query
 
 
 My file size is around 4G and I have 220M lines in my file which have to be 
 loaded in to my table. I have 10 of these files which have to loaded in the 
 same table. My MySQL version is 5.1.59, I have changed the  
 max_allowed_packet to 346030080.
 
 any ideas how I can solve this problem?
   Best regards,
 Javad Bakhshi,
In order to resolve the problem you may need to increase these two values in 
mysql.ini or my.cnf, and restart mysql:

wait_timeout = 28800
connect_timeout = 28800

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

ERROR 2013 (HY000): Lost connection to MySQL server during query

2012-03-01 Thread javad bakhshi
Hi,

I am trying to load data into my table from a very large file but after some 
time I get this error:

ERROR 2013 (HY000): Lost connection to MySQL server during query


My file size is around 4G and I have 220M lines in my file which have to be 
loaded in to my table. 
I have 10 of these files which have to loaded in the same table. 
My MySQL version is 5.1.59, I have changed the  max_allowed_packet to 346030080.

any ideas how I can solve this problem?
 
Best regards,
Javad Bakhshi,

PID and LOG file

2011-11-15 Thread javad bakhshi
Hi,

I am trying to install Mysql on linux which I don't have a root access. I have 
done the folowing :

1. Download source files from http://dev.mysql.com/downloads/mysql/ and un-tar 
thwm
2. configure the instalation using ./configure as:
    CFLAGS=-O3 CXX=gcc CXXFLAGS=-O3 -felide-constructors -fno-exceptions 
-fno-rtti ; \
./configure --prefix=/bubo/home/h10/javad/scratch/mysql \
    --enable-assembler \
    --with-mysqld-ldflags=-all-static \
    --with-client-ldflags=-all-static \
    --with-mysqld-user=javad \
    
--with-unix-socket-path=/bubo/home/h10/javad/scratch/mysql/tmp/mysql.sock \
    --localstatedir=/bubo/home/h10/javad/scratch/mysql/share \
        --datadir=/bubo/home/h10/javad/scratch/mysql/data\
            --enable-thread-safe-client

3. execute ./bin/mysql_install_db
4. execute bin/mysqld_safe  to run mysql. but at this point I get the folowing 
error:
    Starting mysqld daemon with databases from 
/bubo/home/h10/javad/scratch/mysql/data
    ./bin/mysqld_safe: line 394: /var/log/mysqld.log: Permission denied
    ./bin/mysqld_safe: line 402: /var/log/mysqld.log: Permission denied
    STOPPING server from pid file 
/bubo/home/h10/javad/scratch/mysql/data/the.pid
    tee: /var/log/mysqld.log: Permission denied
    15 13:14:18  mysqld ended
    tee: /var/log/mysqld.log: Permission denied

I don't know why I get this error since I have changed the my.cnf to
    err-log=/bubo/home/h10/javad/scratch/mysql/data/the.log
    pid-file=/bubo/home/h10/javad/scratch/mysql/data/the.pid




 
Best regards,
Javad Bakhshi,


Re: Socket not found

2011-10-09 Thread javad bakhshi
Hi,

I had the same problem recently restart the server so it can create your socket 
again and it should be all right.

 
Best regards,
Javad




From: Andrew Moore eroomy...@gmail.com
To: Peter Schrock peter.schr...@gmail.com
Cc: mysql@lists.mysql.com
Sent: Sunday, October 9, 2011 10:51 AM
Subject: Re:Socket not found

Hey Peter,

2 options;

Check the socket key-value in the my.cnf file under the client section.
Explicitly tell mysqladmin what one to use with the relevant cmd line
option. See the documentation for syntax.

Hth

Andrew
On 9 Oct 2011 09:21, Peter Schrock peter.schr...@gmail.com wrote:

 I just loaded and built three different versions of mysql and all three
 versions have given me the same results. When trying to change the password
 to root, this is what I get:

 ./mysqladmin: connect to server at 'localhost' failed
 error: 'Can't connect to local MySQL server through socket
 '/tmp/mysql.sock'
 (2)'
 Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

 Help please.

 Peter


Re: Arrays

2011-09-02 Thread javad bakhshi
Hi again,

Thanks for the tips. My problem is:
I have a Function in Mysql that has some arguments in the signature as follows: 

CREATE FUNCTION Myfunction( type TINYINT, sec SMALLINT, vid INTEGER,
  way TINYINT, quid INTEGER, day TINYINT )
RETURNS CHAR(50)
BEGIN  
DECLARE result CHAR(50);
DECLARE Temp DECIMAL(9,1);
    SELECT Table1( vid, day, way) INTO Temp;
    IF Temp IS NOT NULL THEN
SELECT CONCAT_WS(',',sec, 0, quid, Temp) into result;  

    ELSE

SELECT CONCAT_WS(',',sec, 0, quid, 0 ) into result;  

    END IF;
RETURN result;      
END;


The problem seems to be solved by using CHAR but I really want to have a 
sequence of Integers as the result not CHAR. The reason that I dont use a table 
to insert the result into it and retrieve it later is that this process takes 
more time that It should.  Any thoughts? 
Best regards,
Javad




From: Shawn Green (MySQL) shawn.l.gr...@oracle.com
To: 
Cc: javad bakhshi javadbakh...@yahoo.com; Johan De Meersman 
vegiv...@tuxera.be; mysql@lists.mysql.com mysql@lists.mysql.com
Sent: Monday, August 29, 2011 4:51 PM
Subject: Re: Arrays

On 8/27/2011 11:18,  wrote:
 2011/08/26 13:58 -0700, javad bakhshi
   Thanks guys for the help. but my problem seems to stand unsolved.
 
 Right, no arrays. Nothing is left but table. I used a temporary table, but 
 note that MySQL also does not let table be returned, or passed in. The 
 table-name will be *sigh* global.
 
 

If the table remains an active part of the connection, you always have access 
to it. It is possible to pass the name of the table into a stored procedure and 
use a prepared statement to do nearly anything you want to do with the data.

What is it you are trying to do with this array in the first place?  It sounds 
as though trying to process this data using the set-oriented functions of the 
SQL language is causing you more of a problem than the fact that the language 
doesn't have an array data type.

There are normally many ways to solve any problem. Perhaps if you shared the 
problem you are trying to solve, you can see how many different ways the 
members of the list can solve it without resorting to an array?

-- Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

-- MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=javadbakh...@yahoo.com

Re: Arrays

2011-09-02 Thread javad bakhshi
Hi,

None of the above. :) .This is just an academic research on a benchmark. I just 
want to access my database with this function and return 4 Integer values. 
I separated the numbers with comma to process on it later as an string and 
split the result using string functions which did work. I was just wondering if 
its possible with mysql to return a sequence of numbers or not. I think to 
solve my problem among the ways mentioned before I will create a table with 
Engine=Memory to speed up things. I don't think any other way is possible.
 
Thanks,
Javad



From: Shawn Green (MySQL) shawn.l.gr...@oracle.com
To: javad bakhshi javadbakh...@yahoo.com
Cc: mysql@lists.mysql.com mysql@lists.mysql.com
Sent: Friday, September 2, 2011 2:18 PM
Subject: Re: Arrays

Hello Javad,

On 9/2/2011 05:51, javad bakhshi wrote:
 Hi again,
 
 Thanks for the tips. My problem is:
 I have a Function in Mysql that has some arguments in the signature as
 follows:
 
 CREATE FUNCTION Myfunction( type TINYINT, sec SMALLINT, vid INTEGER,
 way TINYINT, quid INTEGER, day TINYINT )
 RETURNS CHAR(50)
 BEGIN
 DECLARE result CHAR(50);
 DECLARE Temp DECIMAL(9,1);
 SELECT Table1( vid, day, way) INTO Temp;
 IF Temp IS NOT NULL THEN
 SELECT CONCAT_WS(',',sec, 0, quid, Temp) into result;
 
 ELSE
 
 SELECT CONCAT_WS(',',sec, 0, quid, 0 ) into result;
 
 END IF;
 RETURN result;
 END;
 
 
 The problem seems to be solved by using CHAR but I really want to have a
 sequence of Integers as the result not CHAR. The reason that I dont use
 a table to insert the result into it and retrieve it later is that this
 process takes more time that It should. Any thoughts?

Actually, that's not 'the problem' you are attempting to solve at all. That is 
an attempt at a 'solution' to the problem.

If I stare very hard into my crystal ball and use all of my psychic-SQL-fu, all 
I can tell is that you are attempting to build some kind of comma-separated 
value. However, why you need this list and what it is trying to solve is beyond 
me.

Please step back from the SQL end of things for a second and talk to us about 
the actual problem you are trying to solve. Are you generating nuclear launch 
codes? Are you indexing someone's genome? Are you trying to build a web page? 
All of this SQL coding is designed to be a single step in some larger process. 
If you share that larger purpose with us, we may be able to suggest a more 
efficient approach than arrays to solve your larger problem.

Regards,
-- Shawn Green
MySQL Principal Technical Support Engineer
Oracle USA, Inc. - Hardware and Software, Engineered to Work Together.
Office: Blountville, TN

Re: Arrays

2011-08-26 Thread javad bakhshi


 Thanks guys for the help. but my problem seems to stand unsolved.




From: Johan De Meersman vegiv...@tuxera.be
To: Halász Sándor h...@tbbs.net
Cc: mysql@lists.mysql.com
Sent: Friday, August 26, 2011 7:04 PM
Subject: Re: Arrays

- Original Message -
 From: Halász Sándor h...@tbbs.net

 Hi, I would like to create a function in Mysql that returns an Array
 of Numbers. I am trying to run a big amount of stream of data on
 Mysql and I can't afford the time to store the data into a table and
 retrieve it later. 
 Are there any arrays at all in MySQL?

Arrays; no. Functions can return simple numeric/string values; I'm not sure 
wether or not you can return a recordset from a stored procedure.


--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=javadbakh...@yahoo.com

Arrays

2011-08-24 Thread javad bakhshi
Hi,

I would like to create a function in Mysql that returns an Array of Numbers. I 
am trying to run a big amount of stream of data on Mysql and I can't afford the 
time to store the data into a table and retrieve it later. Is there any 
solutions? 
 
Best regards,
Javad Bakhshi,
Computer Science M.Sc
Department of IT, Uppsala University