Re: Problem accessing phpmyadmin using IP from remote machine

2012-12-10 Thread abhishek jain
Can you ping ip 192.168.1.9 from other machines?
On Dec 11, 2012 11:21 AM, Girish Talluru girish.dev1...@gmail.com wrote:

 Hi Guys,

 I have environment as specified below.

 Main server: Windows Server 2008
 Virtual Box:  Oracle VM
 VM OS: Ubuntu

 Inside Ubuntu I downloaded and configured Apache, MySql, PHP and PhpMyadmin
 individually following an article which is mentioned below.

 https://help.ubuntu.com/community/ApacheMySQLPHP

 IP Configuration:
 LAN Address: 192.168.1.9
 VirtualBox Address: 192.168.56.1

 As mentioned in the file I commented the bind address in my.cnf file.

 Using http://localhost/phpmyadmin or http://127.0.0.1/phpmyadmin I could
 able to access the phpmyadmin but when I tried with the LAN/VM address
 http://192.168.1.0/phpmyadmin or http://192.168.56.1/phpmyadmin

 I'm trying this because I have requirement to access phpmyadmin from other
 machines in LAN.

 I tried to change the bind address to VM and LAN address and checked it is
 also not working.

 Can anyone suggest where am I thinking wrong?

 Suggestions please.

 Thanks,
 Girish Talluru



RE: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-24 Thread abhishek jain
Hi,
Or if you are interested in limiting the number of rows add a limit clause,
so that entire resultset of entire table is not returned ,

I am not sure how will that be done , but i have seen some GUIs doing that,
would look for a solution from group.

Thanks
Abhishek 

 -Original Message-
 From: Martin Gainty [mailto:mgai...@hotmail.com]
 Sent: 24 September 2012 04:58
 To: fuller.art...@gmail.com; pownall...@gmail.com
 Cc: mysql@lists.mysql.com
 Subject: RE: How to block SELECT * FROM table; but not SELECT * FROMT
 table WHERE...;
 
 
 Possibly run your constructed query thru a regex expression e.g.
 String mydata = SELECT * from table WHERE ab;; Pattern pattern =
 Pattern.compile('WHERE'); Matcher matcher = pattern.matcher(mydata);
 if (matcher.find()) {  //WHERE clause found proceed normally } else
 throw new Exception(WHERE clause not found); Martin
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de
 confidentialité
 
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
 unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
 Diese Nachricht dient lediglich dem Austausch von Informationen und
 entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
 Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt
 uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
 le destinataire prévu, nous te demandons avec bonté que pour satisfaire
 informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
 copie de ceci est interdite. Ce message sert à l'information seulement
 et n'aura pas n'importe quel effet légalement obligatoire. Étant donné
 que les email peuvent facilement être sujets à la manipulation, nous ne
 pouvons accepter aucune responsabilité pour le contenu fourni.
 
 
  Date: Sun, 23 Sep 2012 18:38:58 -0400
  Subject: Re: How to block SELECT * FROM table; but not SELECT * FROMT
  table WHERE...;
  From: fuller.art...@gmail.com
  To: pownall...@gmail.com
  CC: mysql@lists.mysql.com
 
  Tim,
 
  I think you misunderstood the question. Daniel wants to block Select
  queries that ask for all rwows, and permit only queries that ask for
  some rows, as restricted by the Where clause.
 
  Unfortunately, I don't think that can be done. But I'm not certain of
  that; there might be a trick.
 
  Arthur
  www.artfulsoftware.com
 
  On Sun, Sep 23, 2012 at 3:50 PM, Tim Pownall pownall...@gmail.com
 wrote:
 
select * from table where column=value means it will return only
   rows that match.  as long as you have proper indexing there should
 not be any issues.
  
   On Sun, Sep 23, 2012 at 1:23 PM, Luis Daniel Lucio Quiroz 
   luis.daniel.lu...@gmail.com wrote:
  
  
 


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



Which Database when lot of insert / update queries to execute

2012-06-15 Thread abhishek jain
hi,
I am biased on mysql, and hence i am asking this on mysql forum first.
I am designing a solution which will need me to import from CSV, i am using
my JAVA code to parse. CSV file has 500K rows, and i need to do it thrice
an hour, for 10 hours  a day.
The Queries will mainly be update but select and insert also at times,
The database size will be estimated to be about 5GB.
I need to know is this a classic case for a NOSQL database or mysql is a
good option.

Also , if i need to do 'group by', on a column on a large table what should
i keep in mind, is it advisable,

Please advice,

-- 
Thanks and kind Regards,
Abhishek jain


RE: One table gets locked by itself

2012-05-08 Thread abhishek jain
Hi
Thanks,
Where can i find query log for previous one,or i have to do some config in
my.ini file, please let me know,
Thanks
Abhi 

-Original Message-
From: Darryle [mailto:dstepli...@gmail.com] 
Sent: 08 May 2012 19:42
To: abhishek jain
Cc: mysql@lists.mysql.com
Subject: Re: One table gets locked by itself

Chech your query log for queries hitting that tables. Myisam tables dont
have row level locking. There is probably a slow query somewhere. 

Sent from my iPhone

On May 8, 2012, at 10:04 AM, abhishek jain abhishek.netj...@gmail.com
wrote:

 Hi
 
 I am facing a strange problem, from the last few days in one of my 
 projects in production, i find that one of my table fails to retrieve 
 or insert records,
 
 I think it gets locked somehow, certainly my code doesn't have code to 
 do so explicitly. All / rest of tables are fine, only one table creates
problem.
 All is well after i restart mysqld.
 
 
 
 Dont know what to check!
 
 
 
 Details are:
 
 Mysqld version: 5.0.x
 
 Linux - Centos 5
 
 Table : MyISAM
 
 
 
 Please help me asap,
 
 Thanks,
 
 Abhi
 
 
 


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



Deleting the duplicate values in a column

2011-05-09 Thread abhishek jain
hi,
If we have a following mysql table:
Name - ids
A  1
B  1
C  2
D  3

I want to remove all duplicate occurances and have a result like
Name - ids
C   2
D   3

how can i do that with a query in mysql

Pl. help asap
-- 
Thanks and kind Regards,
Abhishek jain


reset auto increment to a lesser value

2008-08-02 Thread abhishek jain
Hello friends,
I need to reset auto increment to a lesser value, is there a metod to do so
in any version of mysql.
Pl. help me.
Thanks
abhi


Re: reset auto increment to a lesser value

2008-08-02 Thread abhishek jain
On Sat, Aug 2, 2008 at 10:49 PM, Nacho Garcia [EMAIL PROTECTED] wrote:

 http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html

 mysql *ALTER TABLE tbl AUTO_INCREMENT = 100;*



 On Sat, Aug 2, 2008 at 5:28 PM, abhishek jain [EMAIL PROTECTED] wrote:

 Hello friends,
 I need to reset auto increment to a lesser value, is there a metod to do
 so
 in any version of mysql.
 Pl. help me.
 Thanks
 abhi



Hi Nacho,
Thanks for the reply,
But as per a thread on this link, if the resetted value is less than the
highest value already in table then the effective increment value will start
from highest number and not from 100.
I have deleted some rows and i want the increment to start from those
row-ids.
Pl. reply,
Thanks,
Abhi


Fwd: Calendar event query

2007-08-31 Thread abhishek jain
On 8/30/07, C.R.Vegelin [EMAIL PROTECTED] wrote:

 Hi Abhishek,

 Maybe it's off topic, but do you know:
 http://dev.mysql.com/downloads/other/eventum/
 a ready-to-use issue tracking system ...
 maybe also suitable for your purposes.

 Regards, Cor

 - Original Message -
 From: abhishek jain [EMAIL PROTECTED]
 Subject: Calendar event query


  Hi friends,
  I need to make a calendar with some events.
  I have created an events table with the parameters like:
  eventid
  event_from
  event_till
  recurring
  recurring_after_day
  event_type
  userid
 
  and so on.
  My problem is to prepare a query which can give me events on a
 particular
  day or rather all days(in case of calendar view is daily) ,months(if
 view
  is
  monthly) and so on for year week including for events which are repeated

  also, so that i can show that on my calendar.The query will run on a
  fairly
  large no of users also so it should be efficient.
 
  I think the catch is about the recurring events. As for them the entry
  will
  be in one row and they will have virtually many rows one for each
  recurring
  event.
 
  So i want somthing like this for a particular userid :
  event_on count(*) event_type
  235 7
  237 8
  246 6
  254  6
  26   10 6
  27   15
  .
 
  Pl. help me
  Thanks,
  Abhishek jain
 



Hi ,
eventum will not solve my purpose.
Pl. reply the calendar script is urgent and i need a query to actually give
me all events within a time period including the recurring events,
Thanks,
Abhishek jain


Calendar event query

2007-08-30 Thread abhishek jain
Hi friends,
I need to make a calendar with some events.
I have created an events table with the parameters like:
eventid
event_from
event_till
recurring
recurring_after_day
event_type
userid

and so on.
My problem is to prepare a query which can give me events on a particular
day or rather all days(in case of calendar view is daily) ,months(if view is
monthly) and so on for year week including for events which are repeated
also, so that i can show that on my calendar.The query will run on a fairly
large no of users also so it should be efficient.

I think the catch is about the recurring events. As for them the entry will
be in one row and they will have virtually many rows one for each recurring
event.

So i want somthing like this for a particular userid :
event_on count(*) event_type
235 7
237 8
246 6
254  6
26   10 6
27   15
.

Pl. help me
Thanks,
Abhishek jain


Urgent: mysql_history on windows ?

2007-05-03 Thread Abhishek Jain
Hi,
I need to track the mysql commands executed on mine system , I am running 
windows with mysql 5.x 
I know there is a file .mysql_history and hopes there must be a similar file on 
windows too.

Pl. help me urgently,
Thanks,
--
Regards,
Abhishek Jain


Query needed for this sol.

2007-04-08 Thread abhishek jain

Hi all,
I need a query for the fol. sol.
In a table i have 100s of rows with six categories like A,B,C,D,E,F which is
marked with a column like
Table
ID Category
1   A
2   A
3  B
4   B
5  B
6 C
7 C

and so on 100 ids for each of six categories , i want to delete all but 10
ids of each category, i wanted to know how to do so,

Pl. help
Thanks,
Abhishek jain


Re: Google like search string to be implemented

2007-03-11 Thread abhishek jain

So is there any other alternative.
Thanks,
Abhishek jain


On 3/10/07, Michael Dykman [EMAIL PROTECTED] wrote:


LIKE and NOT LIKE can be a dangerous path..  it is very easy to put
yourself in a situation where your logic design requires full table
scans for every query..

- michael dykman


On 3/9/07, abhishek jain [EMAIL PROTECTED] wrote:
 On 3/8/07, abhishek jain  [EMAIL PROTECTED] wrote:
 
 
 
  On 3/6/07, abhishek jain [EMAIL PROTECTED] wrote:
  
  
  
   On 3/6/07, Nils Meyer [EMAIL PROTECTED]  wrote:
  
Hi,
   
abhishek jain wrote:
 I am having a database with varchar(255) columns named title,
 extra_info1,extra_info2,extra_info3 .
 I want to search all these columns with a search string given to
me
via a
 form ,I am using PERL, the string will be like

 +abhishek jain -abcd this should be exact
   
I think MySQL fulltext search in boolean mode would be the perfect
choice for that:
   
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
   
You can use search strings like your example with that directly.
   
regards
Nils
  
  
   Hi Nils and all,
   I have gone through full text and here is a few limitations i find,
   1. works only wiht MyISAM , now if i use innodb then ? anways this
is
   not a major restrictions and can be removed,
   2)Now i can not match within a word i mean the given word even in
   Boolean mode must start with the particular string word, even *
would not
   work as the search string word should start with that, This is a
major
   restriction.
   3. i am not sure how to implement in joins.
  
   Pl. help,
   Thanks,
   Abhishek jain
  
  
 
  Hi guys,
  Pl. reply and give an alternative which i can use to include a
partuial
  word in mine search string which i can match in a table coumn,
  Thanks,
  Abhishek jain
 

 Hi,
 What if i use multiple like and not like statements for searching .
 Pl. reply,
 Thanks,
 Abhishek jain



--
- michael dykman
- [EMAIL PROTECTED]

- All models are wrong.  Some models are useful.



Re: Google like search string to be implemented

2007-03-09 Thread abhishek jain

On 3/8/07, abhishek jain [EMAIL PROTECTED] wrote:




On 3/6/07, abhishek jain [EMAIL PROTECTED] wrote:



 On 3/6/07, Nils Meyer [EMAIL PROTECTED]  wrote:

  Hi,
 
  abhishek jain wrote:
   I am having a database with varchar(255) columns named title,
   extra_info1,extra_info2,extra_info3 .
   I want to search all these columns with a search string given to me
  via a
   form ,I am using PERL, the string will be like
  
   +abhishek jain -abcd this should be exact
 
  I think MySQL fulltext search in boolean mode would be the perfect
  choice for that:
 
  http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html
 
  You can use search strings like your example with that directly.
 
  regards
  Nils


 Hi Nils and all,
 I have gone through full text and here is a few limitations i find,
 1. works only wiht MyISAM , now if i use innodb then ? anways this is
 not a major restrictions and can be removed,
 2)Now i can not match within a word i mean the given word even in
 Boolean mode must start with the particular string word, even * would not
 work as the search string word should start with that, This is a major
 restriction.
 3. i am not sure how to implement in joins.

 Pl. help,
 Thanks,
 Abhishek jain



Hi guys,
Pl. reply and give an alternative which i can use to include a partuial
word in mine search string which i can match in a table coumn,
Thanks,
Abhishek jain



Hi,
What if i use multiple like and not like statements for searching .
Pl. reply,
Thanks,
Abhishek jain


Re: Google like search string to be implemented

2007-03-07 Thread abhishek jain

On 3/6/07, abhishek jain [EMAIL PROTECTED] wrote:




On 3/6/07, Nils Meyer [EMAIL PROTECTED] wrote:

 Hi,

 abhishek jain wrote:
  I am having a database with varchar(255) columns named title,
  extra_info1,extra_info2,extra_info3 .
  I want to search all these columns with a search string given to me
 via a
  form ,I am using PERL, the string will be like
 
  +abhishek jain -abcd this should be exact

 I think MySQL fulltext search in boolean mode would be the perfect
 choice for that:

 http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

 You can use search strings like your example with that directly.

 regards
 Nils


Hi Nils and all,
I have gone through full text and here is a few limitations i find,
1. works only wiht MyISAM , now if i use innodb then ? anways this is not
a major restrictions and can be removed,
2)Now i can not match within a word i mean the given word even in Boolean
mode must start with the particular string word, even * would not work as
the search string word should start with that, This is a major restriction.
3. i am not sure how to implement in joins.

Pl. help,
Thanks,
Abhishek jain




Hi guys,
Pl. reply and give an alternative which i can use to include a partuial word
in mine search string which i can match in a table coumn,
Thanks,
Abhishek jain


Re: Google like search string to be implemented

2007-03-06 Thread abhishek jain

On 3/6/07, Nils Meyer [EMAIL PROTECTED] wrote:


Hi,

abhishek jain wrote:
 I am having a database with varchar(255) columns named title,
 extra_info1,extra_info2,extra_info3 .
 I want to search all these columns with a search string given to me via
a
 form ,I am using PERL, the string will be like

 +abhishek jain -abcd this should be exact

I think MySQL fulltext search in boolean mode would be the perfect
choice for that:

http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

You can use search strings like your example with that directly.

regards
Nils



Hi Nils and all,
I have gone through full text and here is a few limitations i find,
1. works only wiht MyISAM , now if i use innodb then ? anways this is not a
major restrictions and can be removed,
2)Now i can not match within a word i mean the given word even in Boolean
mode must start with the particular string word, even * would not work as
the search string word should start with that, This is a major restriction.
3. i am not sure how to implement in joins.

Pl. help,
Thanks,
Abhishek jain


Re: Does casing of Table names matter on Linux

2007-03-05 Thread abhishek jain

On 3/5/07, abhishek jain [EMAIL PROTECTED] wrote:


 On 3/1/07, abhishek jain [EMAIL PROTECTED] wrote:



 On 2/28/07, Ow Mun Heng [EMAIL PROTECTED]  wrote:
 
  On Wed, 2007-02-28 at 15:05 +0530, abhishek jain wrote:
   Hi Friends,
   I have been developing one application over Windows and now i want
  to
   move/port that into linux, i want to know will the casing of the
  table name
   matter on linux ie if i have table name as tab1 and i execute query
  like
   select * from TAb1 ,will it make an effect.
   I have found that this is not a problem on windows but it is on
  linux, i
   want a sol. for that a i can not change all the table names as in
  some
   places it is in small case and in other places it is in capital
  case.
 
 
  Yes.. There is a difference. Casing Matters in *nix.
 
  However there is an option for turning if off.
 
  # http://dev.mysql.com/doc/refman/5.0/en/name-case-sensitivity.html
  lower_case_table_names  = 1
 
 
  Hi Friends,
 Thanks for the mails.
 Now i have made a mistake.In mine code i have somwhere capital case and
 in other place the small case for the table names.
 I cannot change the case in mine code and cannot resist the change to
 the Linux .
 What is the remedy now i mean can something be done now to make linux be
 case insensitive,
 Pl. help me,
 Thanks,
 Abhishek jain



So friends ,
If anyone know abt the sol. pl. let me know
Thanks,
Abhishek jain



Google like search string to be implemented

2007-03-05 Thread abhishek jain

Hi Friends,
I am having a database with varchar(255) columns named title,
extra_info1,extra_info2,extra_info3 .
I want to search all these columns with a search string given to me via a
form ,I am using PERL, the string will be like

+abhishek jain -abcd this should be exact

As you can see the word/words prefixed with + should be there somewhere in
the above columns in database ,with - should not be there and within  they
should be exact phrase.
I want a sol. for this,
Pl. help me how to make a search queruy will it be in regex or simople like
and not like , i will be having about 1 lac records in the database.
Thanks,
Abhishek jain


Does casing of Table names matter on Linux

2007-02-28 Thread abhishek jain

Hi Friends,
I have been developing one application over Windows and now i want to
move/port that into linux, i want to know will the casing of the table name
matter on linux ie if i have table name as tab1 and i execute query like
select * from TAb1 ,will it make an effect.
I have found that this is not a problem on windows but it is on linux, i
want a sol. for that a i can not change all the table names as in some
places it is in small case and in other places it is in capital case.
Pl. help me,
Thanks,
Abhishek jain


Re: Does casing of Table names matter on Linux

2007-02-28 Thread abhishek jain

On 2/28/07, Ow Mun Heng [EMAIL PROTECTED] wrote:


On Wed, 2007-02-28 at 15:05 +0530, abhishek jain wrote:
 Hi Friends,
 I have been developing one application over Windows and now i want to
 move/port that into linux, i want to know will the casing of the table
name
 matter on linux ie if i have table name as tab1 and i execute query like
 select * from TAb1 ,will it make an effect.
 I have found that this is not a problem on windows but it is on linux, i
 want a sol. for that a i can not change all the table names as in some
 places it is in small case and in other places it is in capital case.


Yes.. There is a difference. Casing Matters in *nix.

However there is an option for turning if off.

# http://dev.mysql.com/doc/refman/5.0/en/name-case-sensitivity.html
lower_case_table_names  = 1


Hi Friends,

Thanks for the mails.
Now i have made a mistake.In mine code i have somwhere capital case and in
other place the small case for the table names.
I cannot change the case in mine code and cannot resist the change to the
Linux .
What is the remedy now i mean can something be done now to make linux be
case insensitive,
Pl. help me,
Thanks,
Abhishek jain


Data back up for innodb tables - Copy paste

2007-02-18 Thread abhishek jain

Hi,
I want to copy paste the data files of Innodb database, is it possible, i
mean can i just copy the data files like that we do for myisam tables,
Thanks,
Abhishek jain


Re: max_allowed_packet in my.ini

2007-02-04 Thread abhishek jain

On 2/3/07, abhishek jain [EMAIL PROTECTED] wrote:


Hi friends,
I am using mysql 5.0.23-nt on windows, i have to store large binary data
in database, i have used setting like max_allowed_packet=16M in mysqld
section of my.ini  .
Now i have a poblem that i want to create a setup so that the entry gets
added itself into the my,ini , reason being i need to create many setups on
diff. machine and i do not want to search the mysqld section and write the
line and restart mysql . I can however would like to do via mysqladmin or so
if it is possible as i can invoke that via mine .net program

Would appreciate your comments on this,
Thanks .
Abhishek jain



Hi Friends.
Pl. reply,
Thanks,
Abhishek jain


max_allowed_packet in my.ini

2007-02-02 Thread abhishek jain

Hi friends,
I am using mysql 5.0.23-nt on windows, i have to store large binary data in
database, i have used setting like max_allowed_packet=16M in mysqld section
of my.ini  .
Now i have a poblem that i want to create a setup so that the entry gets
added itself into the my,ini , reason being i need to create many setups on
diff. machine and i do not want to search the mysqld section and write the
line and restart mysql . I can however would like to do via mysqladmin or so
if it is possible as i can invoke that via mine .net program

Would appreciate your comments on this,
Thanks .
Abhishek jain


How to keep myqsl backup server

2006-11-23 Thread abhishek jain

Hi friends,
I need to create an application where i will be requiring a backup server
like when one server fails i can switch automatically to the other server
hosted somewhere else , now the data needs to be consistent on both the
servers, one sol is i keep automated backups on the primary server and
restore it by a script on the backup server, but i need to know how will i
switch between servers and if i use domain names instead of ips how will i
make immediate switch.
I know some part of the question is not appropriate for this mailing list
but pl help.
Regards,
Abhishek jain


Re: Urgent: How to decode base64 via mysql V 5.0.x

2006-10-27 Thread abhishek jain

Hi,
Initially i thought it solved the problem but then i realized that the
encoding done by PERL and this mysql function is different.I compated and
found that the  difference is in a new line , in this function the encoded
output is all in one line and the same done via PERL via MIME::Base64 module
gives in a different line after some same no of characters.

Pl. someone give me  a sol. to it.
I coould have attached the files but the mailing list wont support that.
Also pl. forgive mine top posting.
--
Regards,
Abhishek jain


On 10/17/06, Ady Wicaksono [EMAIL PROTECTED] wrote:


http://firestuff.org/wordpress/wp-content/uploads/2006/03/base64.sql

On 10/17/06, abhishek jain  [EMAIL PROTECTED] wrote:
 Hi,
 I want to decode base 64 string via mysql .
 Also i am using aspx .net .
 Pl. help me.
 Urgent reply will be appreciated
 --
 Regards,
 Abhishek jain





Urgent: How to decode base64 via mysql V 5.0.x

2006-10-17 Thread abhishek jain

Hi,
I want to decode base 64 string via mysql .
Also i am using aspx .net .
Pl. help me.
Urgent reply will be appreciated
--
Regards,
Abhishek jain


Re: Urgent: How to decode base64 via mysql V 5.0.x

2006-10-17 Thread abhishek jain

Hi,
Yes that solved the problem and was fast.
I would like to know now that is there anyother way for the same in earlier
versions of mysql.
Thanks again,
--
Regards,
Abhishek jain

On 10/17/06, Ady Wicaksono [EMAIL PROTECTED] wrote:


http://firestuff.org/wordpress/wp-content/uploads/2006/03/base64.sql

On 10/17/06, abhishek jain [EMAIL PROTECTED] wrote:
 Hi,
 I want to decode base 64 string via mysql .
 Also i am using aspx .net .
 Pl. help me.
 Urgent reply will be appreciated
 --
 Regards,
 Abhishek jain





How to get the size of a row

2006-10-07 Thread abhishek jain

Hi,
I wanted to know the size of the data stored in a row of a table.
I mean is there something like select size from table where x...

--
Regards
Abhishek Jain


A tricky Query

2006-10-06 Thread abhishek jain

Hi,
I have a table like :

ID date_from date_to price_code price dateadded
1   07:10:2006  31:12:2099  p11007:10:06
2   17:10:2006  31:12:2099  p12007:10:06
3   27:10:2006  31:12:2099  p11007:10:06
4   01:11:2006  31:12:2099  p12007:10:06
5   05:10:2006  31:12:2099  p12008:10:06
6   10:10:2006  31:12:2099  p12008:10:06
7   25:10:2006  31:12:2099  p12008:10:06

Basically there are price codes and the price , i have to find the effective
price for the date today. The price must be calculated also on the latest
added date.

Pl. help me.
I shall be very grateful.
--
Regards,
Abhishek jain


How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread abhishek jain

Hi,
I have a table structure like :
ID , NAME, PARENT_ID
1 , Top , 0
2 , Level 1 , 1
3 , Level 2 ,2
4 , Another Top , 0


and so on.
I wanted to know the topmost cat. if i have the lowest category id ie. 3 in
this case.
I wanted to get like 3-2-1
Pl. help me , cn i do this in one query, also i do not know how many
sublevels are there,
Thanks,
Abhishek jain


which is better long rows in table or two short row tables

2006-07-13 Thread abhishek jain

Dear Friends,
I was to create a site with quite some heavy mySQL database.
I wanted to know which is better longer rows in a table or two short rows
tables.
When compared in terms of speed etc.

Pl. help me , with this question and any other tip you may find can be
useful to me.

Thanks,
Abhishek jain


What is the best coding ethics related to mysql

2006-05-12 Thread abhishek jain

Hi all,
I have been using mysql from last few years but for small projects only,
recently i have been on to some good projects, I want toknow what is the
best coding practices for mysql to kee it fast etc.
I mean in mine earlier post one friend told me that size upto 4 GB can be
achieved with Mysql.
I want to know:
1)Which is better a long table in terms of nos. of columns or use join and
increase the columns. eg. in simple registration site we have 20 columns ,
we should use it in same table or use it in two diff. tables.
2)To use indexes to the maximum or restrain its use.
3)etc.

Pl. point me to good advanced tutorial of mysql.
Also is there any certification of mysql, php etc.
Thanks,
Abhishek Jain


On what factors does speed of mysql depends

2006-05-08 Thread abhishek jain

Dear Friends,
I have a database with approximately 10 tables with about 1 lakh records
each in 3 tables, I need to know that on what factors does the speed of
mysql depends,
1)Does a table having records effects the speed of data fetch of another
table in the same database.
2)Whats the approximate size of a table ideal for mysql,

Any other factors you want mine attention to be foccused on.
Thanks,
Abhishek Jain


Re: Output to a file

2006-05-07 Thread abhishek jain

On 5/5/06, Rhino [EMAIL PROTECTED] wrote:



- Original Message -
From: Payne [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, May 05, 2006 12:09 AM
Subject: Output to a file


 Hey,

 been trying to output a select statment to a file, all the books I have
 only show how to input from a file, what is the correct way

 I thought I could do select * from my_toy  `/tmp/my_toys`

 But I get an error.


Here is a snippet from some documentation about MySQL which I wrote for
myself. It shows a  different technique for capturing output from a batch
file into an output file; if the batch file contains 'select * from
my_toy',
it will capture the output in a file. It's not exactly what you want but
maybe it will be close enough.

Running a script from OS prompt

If you are connected to the database and are at an OS prompt, use this
pattern:

mysql  batch-file  output-file

For example, if I want to run a script or batch file named
my_batch_file.sql
and write the output of the script to a file named my_batch_file.out, I'd
need to do this:

mysql  my_batch_file.sql  my_batch_file.out

If you are NOT connected to the database, use this pattern:

mysql -u username -p  batch_file  output_file

For example, if your user name is 'fred' and your password is 'dino' and
you
want to run a script or batch file named my_batch_file.sql against
database
'barf' and write the output to a file called my_batch_file.out, you'll
need
to do this:

mysql barf -u fred -p  my_batch_file.sql  my_batch_file.out

[Be sure to supply the password when prompted.]

--

Rhino



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.4/332 - Release Date: 04/05/2006


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



select * into outfile '/tmp/new.txt' from tablename where condition  = '1';
looks to me a good option.
Best Regards,
Abhishek Jain


How to synchronize two databases

2006-05-07 Thread abhishek jain

Dear Friends,
I have two databases with the same name and table structure but the content
is different, I need to synchronize them i mean the data inside one database
need to be updated with the other one leaving the etries which are similar.
Let me give a single example:

DB1:table1
Rows like : userid  name
Ist row   1   abhishek
IInd row  2   jain
III row 3   rahul



DB2:table1
Rows like : userid  name
Ist row   1   abhishek
IInd row  2   amitabh
III row 3   vijay

Now i want  like :
Rows like : userid  name
Ist row   1   abhishek
IInd row  2   jain
III row 3   rahul
IV row 4   amitabh
V row   5  vijay

NOTE: Here DB1 = database names , table1 = table name .
How can i do that via mysql or that i need to prepare a script for this can
anyone help.
Regards,
Abhishek Jain


Re: How to Find Most Recent Autoincrement Index Assigned???

2006-04-22 Thread abhishek jain
Hi,
 Actually i update(increment by 1 ) a value in a table with only one row,
ie. update table1 set col = col+1;
Can i get the updated value without diong select in the same query with
update. Because if i run Select after that than some time is lost and in the
mean time any other process updates the table and i do not get the exact
value.
Thanks,
Abhishek Jain



On 4/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 From 'Section 13.5.3 SET Syntax' of the 5.0.18 ref manual:

 IDENTITY = value

 The variable is a synonym for the LAST_INSERT_ID variable.
 It exists for compatibility with other database systems. You
 can read its value with SELECT @@IDENTITY, and set it using
 SET IDENTITY.


 INSERT_ID = value

 Set the value to be used by the following INSERT or ALTER
 TABLE statement when inserting an AUTO_INCREMENT value. This
 is mainly used with the binary log.


 LAST_INSERT_ID = value

 Set the value to be returned from LAST_INSERT_ID(). This is
 stored in the binary log when you use LAST_INSERT_ID() in a
 statement that updates a table. Setting this variable does
 not update the value returned by the mysql_insert_id() C API
 function.

 Eg.

 mysql select @@last_insert_id;
 +--+
 | @@last_insert_id |
 +--+
 |0 |
 +--+
 1 row in set (0.04 sec)

 mysql select @@insert_id;
 +-+
 | @@insert_id |
 +-+
 |   0 |
 +-+
 1 row in set (0.00 sec)

 mysql select @@identity;
 ++
 | @@identity |
 ++
 |  0 |
 ++
 1 row in set (0.00 sec)

 mysql set @@last_insert_id = 5;
 Query OK, 0 rows affected (0.00 sec)

 mysql select @@last_insert_id;
 +--+
 | @@last_insert_id |
 +--+
 |5 |
 +--+
 1 row in set (0.00 sec)

 mysql select @@insert_id;
 +-+
 | @@insert_id |
 +-+
 |   5 |
 +-+
 1 row in set (0.00 sec)

 mysql select @@identity;
 ++
 | @@identity |
 ++
 |  5 |
 ++
 1 row in set (0.00 sec)

 So it appears you can use either of the three variables
 above to achieve the same effect.

 Regards

 Keith

 On Sat, 22 Apr 2006, Michael Stassen wrote:

  To: David T. Ashley [EMAIL PROTECTED]
  From: Michael Stassen [EMAIL PROTECTED] 
  Subject: Re: How to Find Most Recent Autoincrement Index Assigned???
 
  David T. Ashley wrote:
   I'm using PHP, and I sometimes INSERT new records in a table.  MySQL
   assigns
   a new autoincrement int field on each INSERT ... nothing surprising
   there.
   It goes 1, 2, 3, etc.
  
   What query can I use to find out what value this int autoincrement
   assigned
   field was?  I could of course SELECT based on what was just inserted,
   but
   that seems inefficient.
  
   Thanks for any help,
   Dave.
 
  LAST_INSERT_ID()
 
  http://dev.mysql.com/doc/refman/4.1/en/information-functions.html
 
  Michael

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




Why does this query takes a lot of time

2006-04-22 Thread abhishek jain
Dear Friends,
I have two table joined by the followng query, the problem is this simple
query takes a lot of time greater than 10 mins depending on the number of
records, Pl. help me find out the reason:
Table 1:
id_key primary and auto increment
recordID varchar(100)
login_name varchar(255)
blah
blah


Table 2:
id_key primary and auto increment
recordID varchar(100)
blah
blah


Query:
SELECT count(  *  ) FROM table1 s, table2 c WHERE s.login_name =  'abhishek'
and s.recordID=c.recordID;

recordID in table 1 needs to be same to that in table2.I mean recordID needs
to be the mapping thing.

Pl. help me it is important to me.
Thanks,
Abhishek Jain


Fwd: Fetch and updation in single step/query

2006-04-20 Thread abhishek jain
No i do not want an autoincrement key , as i want to be only one row in the
table and it value gets incremented / updated and i to know whats its
current value.
 --
Regards
Abhishek Jain


On 4/19/06, Michael Kruckenberg [EMAIL PROTECTED] wrote:

 Seems like what you need is an auto-increment key. Is that out of the
 question?

 On Apr 18, 2006, at 1:34 AM, abhishek jain wrote:
  Dear Friends,
  I run several processes and they need to query the mysql 5.0.8
  database
  simultaneously .I have a config table which have the record id. I
  need to
  fetch that and increment that .What I feel that the same record id is
  fetched by different simultaneosly before i update .Can anyone help
  me in
  either:
  1)telling me a single query which will fetch and incr. in the same
  query. so
  the problem of simultaneously queries are solved.
  2)A system by which delaying the other queries are done, I use PHP .
  Expecting a quick reply.
  Thanks,
  Abhishek Jain




How to initiate a prog. via mysql

2006-04-20 Thread abhishek jain
Dear Friends,
I need to start a prog. as soon as a particular field in the mySQL 4.x is
changed. ie. when in Flag table if_flag is set to '1'  i need to start a
script.
The script will be in PHP.
Pl. tell me how to do so on mySQL 4.x.
I shall be very grateful.
--
Regards,
Abhishek Jain


Fetch and updation in single step/query

2006-04-17 Thread abhishek jain
Dear Friends,
I run several processes and they need to query the mysql 5.0.8 database
simultaneously .I have a config table which have the record id. I need to
fetch that and increment that .What I feel that the same record id is
fetched by different simultaneosly before i update .Can anyone help me in
either:
1)telling me a single query which will fetch and incr. in the same query. so
the problem of simultaneously queries are solved.
2)A system by which delaying the other queries are done, I use PHP .
Expecting a quick reply.
Thanks,
Abhishek Jain


How to remove muiltiple queries to a table at the same time

2006-04-15 Thread abhishek jain
Dear Friends,
I run several processes and they need to query the mysql 5.0.8 database
simultaneously .I have a config table which have the record id. I need to
fetch that and increment that .What I feel that the same record id is
fetched by different simultaneosly before i update .Can anyone help me in
either:
1)telling me a single query which will fetch and incr. in the same query. so
the problem of simultaneously queries are solved.
2)A system by which delaying the other queries are done, I use PHP .
Expecting a quick reply.
Thanks,
Abhishek Jain


How to take dump of a query instead of table / database

2006-03-24 Thread abhishek jain
Dear Friends,
I need to take the backup of a query, is it possible.
If yes how.
--
Regards
Abhishek jain
www.smsengine.co.uk


Mysql Finding the country name from country prefix

2005-11-19 Thread abhishek jain

Hi Friends,
I have a ticky mysql problem.
I need to find the country name from the country prefix so eg. i have a 
mysql table with prefix and name as the coumns and with datas like :

Prefix,  Name
1  USA
11XYZ
44UK
91India
92Pakistan
123  ZXF
and i have a number like 911122334455 and i need t match that to india.
I cannt do that directly by this statement select name from 
country_table where prefix='91'; for the simple reason as i do not have 
the length or the no. of digits the prefix is beforehand.

Pl. help me out.
Quick help will be appreciated.
--
--
Regards
*Jain**
*