Question: What Is Hgsql? How To Install And Work With It?
1
gravatar for jitendra
6.4 years ago by
jitendra10
jitendra10 wrote:

I got the following error

make -f infileMakefile testSet=YES MODEL=/data/ra1/Sim/model.txt

**hgsql** -Ne 'select name,chrom,strand,txStart,txEnd,cdsStart,cdsEnd,exonCount,exonStarts,exonEnds,score,name2,cdsStartStat,cdsEndStat,exonFrames from mgcGenes' hg19 > raw/mgcGenes.gp.tmp

/bin/bash: hgsql: command not found
make: *** [raw/mgcGenes.gp] Error 127

Note: I have mysql in my computer.

genome • 2.7k views
ADD COMMENTlink modified 6.4 years ago by Michael Dondrup47k • written 6.4 years ago by jitendra10
1

We have no idea from the question what make is targeting, i.e. what software is being installed.

ADD REPLYlink written 6.4 years ago by Neilfws48k

This might help http://skip.ucsc.edu/FAQ/FAQlicense.html

ADD REPLYlink written 6.4 years ago by ancient_learner630

I think that is some broken mysql wrapper from USCS or so.

ADD REPLYlink modified 6.4 years ago • written 6.4 years ago by Michael Dondrup47k
2
gravatar for Michael Dondrup
6.4 years ago by
Bergen, Norway
Michael Dondrup47k wrote:

This. It's part of the UCSC source tree under /kent/src/hg/hgsql, try to make the src tree from http://hgdownload.cse.ucsc.edu/admin/jksrc.zip

The code below does mostly the same as the follwing shell script:

 #!/bin/sh 
 mysql -uuser -ppass $@

where it reads user and pass from some config file.

(A C program to execute mysql, WTH? xD)

   /* hgsql - Execute some sql code using passwords in .hg.conf. */
#include "common.h"
#include "options.h"
#include "hgConfig.h"
#include "sqlProg.h"


void usage()
/* Explain usage and exit. */
{
errAbort(
  "hgsql - Execute some sql code using passwords in .hg.conf\n"
  "usage:\n"
  "   hgsql [mysqlOptions] [database]\n"
  "or:\n"
  "   hgsql [mysqlOptions] [database] < file.sql\n"
  "Generally anything in command line is passed to mysql\n"
  "after an implicit '-A -u user -ppassword'.  If no options\n"
  "or database is specified, this usage message is printed."
  "\n"
  );
}

void hgsql(int argc, char *argv[])
/* hgsql - Execute some sql code using passwords in .hg.conf. */
{
static char *progArgs[] = {"-A", NULL};
sqlExecProg("mysql", progArgs, argc, argv);
}

int main(int argc, char *argv[])
/* Process command line. */
{
if (argc < 1)
    usage();
hgsql(argc-1, argv+1);
return 0;  /* never reaches here */
}
ADD COMMENTlink modified 6.4 years ago • written 6.4 years ago by Michael Dondrup47k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1155 users visited in the last hour