Re: help with storing a large binary number as bigint

2006-06-01 Thread Sameer


You could use the mysql CAST or CONVERT functions

Byron.Albert wrote:


Hey all,

This should be a relatively simple question but after looking through
the manual for a while I didn't see how to do it. I am working in php
and need to store a large binary number in the database. When I try and
convert it to a int in php its too big so it converts it to a float and
I loose all all precision witch makes it worthless to me. Is there a way
to let mysql do the conversion since the number I am working with is
48bits and bigint can store 63bits??? I would need to be able to insert
and select it as a binary string?

Thanks for any help.


Byron Albert 



 





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



Re: Order by leads to an empty set.

2006-05-09 Thread Mohammed Sameer
On Tue, May 09, 2006 at 12:13:41PM -0400, Rhino wrote:
> 
> - Original Message - 
> From: "Mohammed Sameer" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, May 09, 2006 9:56 AM
> Subject: Order by leads to an empty set.
> 
> 
> >Hi all,
> >
> >I have a strange problem and I can't really understand what's going on!
> >
> >mysql> SELECT n.nid, n.sticky, n.created FROM node n WHERE n.type='image' 
> >AND (n.uid = 1 OR n.status = 1) ORDER BY n.created desc;
> >Empty set (0.00 sec)
> >
> >mysql> SELECT n.nid, n.sticky, n.created FROM node n WHERE n.type='image' 
> >AND (n.uid = 1 OR n.status = 1);
> >+-+++
> >| nid | sticky | created|
> >+-+++
> >|  73 |  0 | 1141048224 |
> >|  75 |  0 | 1141736038 |
> >.
> >|  93 |  0 | 1145039899 |
> >|  97 |  0 | 1145189131 |
> >+-+++
> >51 rows in set (0.00 sec)
> >
> >
> >I'm using a standar drupal installation:
> >mysql> desc node;
> >+--+--+--+-+-++
> >| Field| Type | Null | Key | Default | Extra  |
> >+--+--+--+-+-++
> >| nid  | int(10) unsigned |  | PRI | NULL| auto_increment |
> >| type | varchar(32)  |  | MUL | ||
> >| title| varchar(128) |  | MUL | ||
> >| uid  | int(10)  |  | MUL | 0   ||
> >| status   | int(4)   |  | MUL | 1   ||
> >| created  | int(11)  |  | MUL | 0   ||
> >| changed  | int(11)  |  | MUL | 0   ||
> >| comment  | int(2)   |  | | 0   ||
> >| promote  | int(2)   |  | MUL | 0   ||
> >| moderate | int(2)   |  | MUL | 0   ||
> >| sticky   | int(2)   |  | | 0   ||
> >| vid  | int(10) unsigned |  | | 0   ||
> >+--+--+--+-+-++
> >12 rows in set (0.00 sec)
> >
> >| version | 4.1.12
> >CentOS release 4.2 (Final)
> >
> >Any idea ? Am I doing something wrong ? Did I hit a bug ?
> >
> If the two queries really are identical except that one has an ORDER BY 
> added to it, this would appear to be a bug, although it would be a VERY 
> strange one! But a bug isn't the _only_ possibility; in fact, I can think 
> of three things that are probably much more likely.

Then I did hit a bug, I tried various combinations of queries!
It's very strange:

mysql> SELECT n.nid FROM node n WHERE n.type='image'  AND (n.uid = 1 OR 
n.status = 1)  ORDER BY n.created desc; 
Empty set (0.00 sec)

mysql> SELECT COUNT(n.nid) FROM node n WHERE n.type='image'  AND (n.uid = 1 OR 
n.status = 1)  ORDER BY n.created desc; 
+--+
| COUNT(n.nid) |
+--+
|   53 |
+--+
1 row in set (0.00 sec)

I thought it might be a bug in the mysql client, I tried to connect remotely
but it failed too.

> 1. Is there any possibility that a DELETE took place between the first 
> query and the second?

No!

> 2. Is there any possibility that the two queries took place against 
> different tables or databases or systems?

No!

> 3. Is there any possibility that the query with the ORDER BY which you have 
> given us in your email is not the one which returned 0 rows and that it is 
> not identical to the other query that lacks the ORDER BY? The best approach 
> for reporting query problems is to copy and paste the query from your MySQL 
> environment into your email but some people simply type the query directly 
> into the email. That opens the possibility that you typed the query 
> inaccurately and may explain the problem.

I did a copy and paste from my terminal!


> Frankly, I find it quite unlikely that ORDER BY would fail so I would 
> strongly recommend that you consider the alternate scenarios I have 
> suggested and rule those out first. If you can rule them out, then you may 
> have encountered a real bug. Naturally, you should report that bug if you 
> can satisfy yourself that it really IS a bug.

Looks like it is really a bug and honestly, I'm shocked!

I know it's FLOSS as I'm a FLOSS developer myself and nothing is perfect but 
order by!!

Thanks for your reply, I'll re

Order by leads to an empty set.

2006-05-09 Thread Mohammed Sameer
Hi all,

I have a strange problem and I can't really understand what's going on!

mysql> SELECT n.nid, n.sticky, n.created FROM node n WHERE n.type='image' AND 
(n.uid = 1 OR n.status = 1) ORDER BY n.created desc;
Empty set (0.00 sec)

mysql> SELECT n.nid, n.sticky, n.created FROM node n WHERE n.type='image' AND 
(n.uid = 1 OR n.status = 1);
+-+++
| nid | sticky | created|
+-+++
|  73 |  0 | 1141048224 |
|  75 |  0 | 1141736038 |
.
|  93 |  0 | 1145039899 |
|  97 |  0 | 1145189131 |
+-+++
51 rows in set (0.00 sec)


I'm using a standar drupal installation:
mysql> desc node;
+--+--+--+-+-++
| Field| Type | Null | Key | Default | Extra  |
+--+--+--+-+-++
| nid  | int(10) unsigned |  | PRI | NULL| auto_increment |
| type | varchar(32)  |  | MUL | ||
| title| varchar(128) |  | MUL | ||
| uid  | int(10)  |  | MUL | 0   ||
| status   | int(4)   |  | MUL | 1   ||
| created  | int(11)  |  | MUL | 0   ||
| changed  | int(11)  |  | MUL | 0   ||
| comment  | int(2)   |  | | 0   ||
| promote  | int(2)   |  | MUL | 0   ||
| moderate | int(2)   |  | MUL | 0   ||
| sticky   | int(2)   |  | | 0   ||
| vid  | int(10) unsigned |  | | 0   ||
+--+--+--+-+-++
12 rows in set (0.00 sec)

| version | 4.1.12
CentOS release 4.2 (Final)

Any idea ? Am I doing something wrong ? Did I hit a bug ?

Many thanks,

-- 
GNU/Linux registered user #224950
Proud Egyptian GNU/Linux User Group  Member.
Life powered by Debian, Homepage: www.foolab.org
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.gnu.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature

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



Re: Formatting Date to make counts easy.

2005-12-15 Thread Sameer

Payne wrote:


Hi,

I having a problem doing a simple count with the way date is format 
2005-12-11 21:49:36, what I am wanting to do is a simple count where 
it only returns just the date. What do i need to do to get it where is 
(2005-12-11) and for that matter switch the date to us format. Here 
the sql statement I am doing now.


select count(*), date from my_db group by date;

Thanks, for any help you can give me.

Payne





select count(*), DATE_FORMAT(some_date, '%Y-%m-%d') from some_table
group by DATE_FORMAT(some_date, '%Y-%m-%d');


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



stored procedure - updating record by record

2005-12-01 Thread Mohammed Sameer

_using mysql5

_I have a table "points"  with (atleast) following fields
points_id (int, primary key), logged (datetime), sale_points(float), 
available_points(float)


When a new row is inserted "available_points" is set to the value of 
"sale_points"


I need to update the "available points" for each record starting from 
oldest (from "logged" field) record


For example, i have the following records in points table

points_id,logged,sale_points,available_points
1"2005-12-02 12:43:44"100   100
2"2005-12-02 12:44:02"20 20
3"2005-12-02 12:44:09"1000 1000
4"2005-12-02 12:44:47"450   450
5"2005-12-02 12:44:56"10 10

Suppose i have a procedure "use_points" which accepts a float parameter 
(points to use)

After executing "use_points" say:
use_points (620);
i expect it to use (update "available_points")  100  from 1 
("points_id") leaving 0 "available_points", 20 from 2 leaving 0 
"available_points", and 100 from 3 leaving 500 "available_points"


The resulting data in the points table should be

points_id,logged,sale_points,available_points
1"2005-12-02 12:43:44"100   0
2"2005-12-02 12:44:02"20 0
3"2005-12-02 12:44:09"1000 500
4"2005-12-02 12:44:47"450   450
5"2005-12-02 12:44:56"10 10


This is a how i intend to do the above

CREATE PROCEDURE use_points ( my_points FLOAT)
BEGIN
DECLARE cur_id INTEGER DEFAULT 0;
DECLARE cur_points FLOAT DEFAULT 0;

WHILE my_points > 0  DO

SELECT points_id, available_points INTO cur_id, cur_points
FROM points
WHERE logged = (SELECT MIN(logged) FROM points WHERE available_points > 0)
AND available_points > 0
ORDER BY points_id LIMIT 1;

IF my_points < cur_points THEN
 UPDATE points SET available_points = cur_points - my_points WHERE 
points_id = cur_id;

ELSE
 UPDATE points SET available_points = 0 WHERE points_id = cur_id;
END IF;

SET my_points = my_points - cur_points;
END WHILE;
END

Is there a better and optimized way of doing this?
Thanks in advance


explicit row locking in InnoDB

2005-05-22 Thread Mohammed Sameer
 
need some urgent help

im using InnoBD database type...i need to explicitly lock a row and keep it 
locked until i explicitly unlock that row..

it would be great if u could provide me with sql statements as a solution for 
the above...



thanks 


Re: stopping server from pid file error

2005-03-18 Thread Mohammed Sameer
On Fri, Mar 18, 2005 at 11:02:50AM -0600, sharif islam wrote:
> # mysqld_safe
> Starting mysqld daemon with databases from /var/lib/mysql
> STOPPING server from pid file /var/lib/mysql/mymachine.pid
> 050318 11:01:31  mysqld ended
> 
> [EMAIL PROTECTED] mysql]# ls -la /var/lib/mysql
> total 40
> drwxrwxr-x   4 mysql mysql 4096 Mar 18 10:54 .
> drwxr-xr-x  22 root  root  4096 Feb 25 14:22 ..
> drwxrwx--x   2 mysql mysql 4096 Feb 25 14:22 mysql
> drwxrwxr-x   2 mysql mysql 4096 Feb 25 14:22 test
> -rw-rw   1 mysql mysql 1953 Mar 18 11:01 mymachine.err
> 
> There's no mymachine.pid. The permission on /var/lib/mysql seems to be
> right. I am using Fedora core 3.
> 


have a look at mymachine.err
In most cases you'll find the reason there.

-- 

-- Katoob Main Developer, Arabbix Maintainer.
GNU/Linux registered user #224950
Proud Egyptian GNU/Linux User Group  Admin.
Life powered by Debian, Homepage: www.foolab.org
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.gnu.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature


signature.asc
Description: Digital signature


Re: AW: [PHP] How to argue with ASP people...

2004-12-31 Thread Mohammed Sameer

On Fri, Dec 31, 2004 at 05:17:27PM -0600, Bob Ramsey wrote:
> 
> The only snage with the header function is that you must not print or
> echo anything to the browser before you use it.  In other words you
> can't do this:
> 
> 
> 
> I moved you to another page.
> http://someotherpage.com";); ?>
> 
> 

If you have output buffering turned on in your php.ini you can do it IMHO.

-- 

-- Katoob Main Developer, Arabbix Maintainer.
GNU/Linux registered user #224950
Proud Egyptian GNU/Linux User Group  Admin.
Life powered by Debian, Homepage: www.foolab.org
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.fsf.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature


signature.asc
Description: Digital signature


Re: MySQL blocking ACPI suspend

2004-07-17 Thread Mohammed Sameer
On Sat, Jul 17, 2004 at 11:25:33PM +0200, Loic Minier wrote:
>  Did other MySQL users experience this?

I can confirm this on Debian testing and fedora core 2

-- 

-- Katoob Main Developer
Linux registered user #224950, ICQ #58475622
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.fsf.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature
--
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT d-(++)@ s+(++):->+++ a-- C+++$> UL+++$> P+++$>+
L+++()$>+ E>+++ W++?>$ N+>+++ o? K-? !w++ !O !M !V !PS@ !PE@ Y+ PGP=+++
t? 5? !X R? tv-- b+@ DI D+ G-- e++>+++ h-->++ !r y?
--END GEEK CODE BLOCK--


signature.asc
Description: Digital signature


Re: Please help me optimize a MySQL server.

2004-05-19 Thread Mohammed Sameer
On Wed, May 19, 2004 at 11:36:38AM -0400, Brent Baisley wrote:
> I wouldn't upgrade until you know where the bottleneck is (CPU, disk, 
> network, or RAM). Since you are using "professional" software, I 
> wouldn't try to change the queries. Have you made changes to your 
> my.cnf file? Since you have enough ram to hold all the data, ram is 
> probably not your bottleneck. The question is whether you have your 
> system configured to use it.

Here is the uncommented parts in the /etc/my.cnf:
[client]
port= 3306
socket  = /tmp/mysql.sock

[mysqld]
port= 3306
socket  = /tmp/mysql.sock
key_buffer = 384M
skip-locking
set-variable= max_connections=3500
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
thread_concurrency = 2
server-id   = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

> I forget if phpbb and phpnuke use PEAR::DB to access the underlying 
> database. If they do, there is a certain amount of overhead involved 
> that you just can't get around without changing the database access 
> code to use "native" calls. Are your database and web server on the 
> same machine (a security no-no, but performance yes-yes)? If they are 
> on separate machines, make sure you have a fast connection between 
> them, at least 100MB and make sure it's full duplex.
> 
I think they don't use it, The database on a separate server, with a 1000MB LAN 
connection, Same for the 2 webservers.
I verified this now.

> 
> On May 19, 2004, at 10:34 AM, Mohammed Sameer wrote:
> 
> >On Wed, May 19, 2004 at 08:47:28AM -0400, Brent Baisley wrote:
> >>Something that small shouldn't really need optimizing. What is the 
> >>size
> >>of your data (mb?, gb?) and what does your query look like? If you are
> >>doing a wild card search on a large text field without a full text
> >>index, then those times may be the best you're going to get. Many 
> >>times
> >>it's about optimizing your query statement or you indexes rather than
> >>MySQL settings.
> >mainly we are using 2 databases:
> >675M for phpbb and 77M for phpnuke. That's not much.
> >Ok, It seems that the actual queries performed by phpbb are optimized.
> >
> >>For instance, I have a test machine (Mac G4 400Mhz, 512MB, MySQL
> >>4.0.18) that does a three table join with each table having just over
> >>100,000 rows. My initial query took about 12 seconds, but changing my
> >>query statement around a little I got it to just under 1 second. Which
> >>is pretty good considering the hardware it's on.
> >>What does you explain for the query look like? It's probably doing a
> >>full table scan, which means you're bottleneck is the disk.
> >>
> >
> >but the server is running on a duel P III with 2 GB RAM and a RAID 
> >controller.
> >Do you think there is much to be done, or shall I look for better 
> >hardware/or clustering ?
> >
> >>On May 19, 2004, at 3:26 AM, Mohammed Sameer wrote:
> >>
> >>>Hi,
> >>>I'm running a MySQL server on a duel P III 1G, with 2 GB RAM.
> >>>MySQL 4.0.18 compiled from source.
> >>>
> >>>We have 2 webservers running apache, And this is the backend database
> >>>server.
> >>>The server is really slow.
> >>>a select on a table with 138,247 rows takes about 1.6 - 2+ seconds, I
> >>>have about 50% CPU idle.
> >>>
> >>>using MyISAM table types.
> >>>
> >>>sure I can provide any statistics about the running server.
> >>>Do you think that switching to innodb'd help ? Is it a problem with
> >>>Debian woody ??
> >>>Any suggestions are welcomed.
> >>>
> >>>Many thanks!
> >>>
> >>>-- 
> >>>
> >>>-- Katoob Main Developer
> >>>Linux registered user #224950, ICQ #58475622
> >>>--
> >>>Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
> >>>Read http://www.fsf.org/philosophy/no-word-attachments.html
> >>>Preferable attachments: .PDF, .HTML, .TXT
> >>>Thanx for adding this text to Your signature
> >>>--
> >>>-BEGIN GEEK CODE BLOCK-
> >>>Version: 3.1
> 

Re: Please help me optimize a MySQL server.

2004-05-19 Thread Mohammed Sameer
On Wed, May 19, 2004 at 08:47:28AM -0400, Brent Baisley wrote:
> Something that small shouldn't really need optimizing. What is the size 
> of your data (mb?, gb?) and what does your query look like? If you are 
> doing a wild card search on a large text field without a full text 
> index, then those times may be the best you're going to get. Many times 
> it's about optimizing your query statement or you indexes rather than 
> MySQL settings.
mainly we are using 2 databases:
675M for phpbb and 77M for phpnuke. That's not much.
Ok, It seems that the actual queries performed by phpbb are optimized.

> For instance, I have a test machine (Mac G4 400Mhz, 512MB, MySQL 
> 4.0.18) that does a three table join with each table having just over 
> 100,000 rows. My initial query took about 12 seconds, but changing my 
> query statement around a little I got it to just under 1 second. Which 
> is pretty good considering the hardware it's on.
> What does you explain for the query look like? It's probably doing a 
> full table scan, which means you're bottleneck is the disk.
> 

but the server is running on a duel P III with 2 GB RAM and a RAID controller.
Do you think there is much to be done, or shall I look for better hardware/or 
clustering ?

> On May 19, 2004, at 3:26 AM, Mohammed Sameer wrote:
> 
> >Hi,
> >I'm running a MySQL server on a duel P III 1G, with 2 GB RAM.
> >MySQL 4.0.18 compiled from source.
> >
> >We have 2 webservers running apache, And this is the backend database 
> >server.
> >The server is really slow.
> >a select on a table with 138,247 rows takes about 1.6 - 2+ seconds, I 
> >have about 50% CPU idle.
> >
> >using MyISAM table types.
> >
> >sure I can provide any statistics about the running server.
> >Do you think that switching to innodb'd help ? Is it a problem with 
> >Debian woody ??
> >Any suggestions are welcomed.
> >
> >Many thanks!
> >
> >-- 
> >
> >-- Katoob Main Developer
> >Linux registered user #224950, ICQ #58475622
> >--
> >Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
> >Read http://www.fsf.org/philosophy/no-word-attachments.html
> >Preferable attachments: .PDF, .HTML, .TXT
> >Thanx for adding this text to Your signature
> >--
> >-BEGIN GEEK CODE BLOCK-
> >Version: 3.1
> >GCM/IT d-(++)@ s+(++):->+++ a-- C+++$> UL+++$> P+++$>+
> >L+++()$>+ E>+++ W++?>$ N+>+++ o? K-? !w++ !O !M !V !PS@ !PE@ 
> >Y+ PGP=+++
> >t? 5? !X R? tv-- b+@ DI D+ G-- e++>+++ h-->++ !r y?
> >--END GEEK CODE BLOCK--
> >
> -- 
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
> 

-- 

-- Katoob Main Developer
Linux registered user #224950, ICQ #58475622
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.fsf.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature
--
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT d-(++)@ s+(++):->+++ a-- C+++$> UL+++$> P+++$>+
L+++()$>+ E>+++ W++?>$ N+>+++ o? K-? !w++ !O !M !V !PS@ !PE@ Y+ PGP=+++
t? 5? !X R? tv-- b+@ DI D+ G-- e++>+++ h-->++ !r y?
--END GEEK CODE BLOCK--


signature.asc
Description: Digital signature


[uniball@gmx.net: Re: Please help me optimize a MySQL server.]

2004-05-19 Thread Mohammed Sameer
sorry Egor Egorov, Mutt sent the mail to your private inbox ;)
resending to the mailing list.

On Wed, May 19, 2004 at 02:02:29PM +0300, Egor Egorov wrote:
> Mohammed Sameer <[EMAIL PROTECTED]> wrote:
> > I'm running a MySQL server on a duel P III 1G, with 2 GB RAM.
> > MySQL 4.0.18 compiled from source.
> >
> > We have 2 webservers running apache, And this is the backend database server.
> > The server is really slow.
> > a select on a table with 138,247 rows takes about 1.6 - 2+ seconds, I have about 
> > 50% CPU
> > idle.
> >
> > using MyISAM table types.
> >
> > sure I can provide any statistics about the running server.
> > Do you think that switching to innodb'd help ? Is it a problem with Debian woody ??
> > Any suggestions are welcomed.
Thanks for replying...

> 
> Does MySQL use indexes? You can check it with EXPLAIN SELECT:
>   http://dev.mysql.com/doc/mysql/en/EXPLAIN.html
> 
It's phpBB and phpnuke "still fighting with them to trash phpnuke" default tables.
The website is really active, with about 67000 visits/day.
We are using a RAID controller for the server.

> Some optimization tips you can find at:
>   http://dev.mysql.com/doc/mysql/en/MySQL_Optimisation.html

I tried all this, but no use.
CPU idle is usually 0%
a 1.5 gig log file was generated in about 12h or so.
move to innodb from MyISAM ? Is it a Debian woody problem ? load balancing ?

I tried to do what I can, but nothing improved the performance.

-- 

-- Katoob Main Developer
Linux registered user #224950, ICQ #58475622
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.fsf.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature
--
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT d-(++)@ s+(++):->+++ a-- C+++$> UL+++$> P+++$>+
L+++()$>+ E>+++ W++?>$ N+>+++ o? K-? !w++ !O !M !V !PS@ !PE@ Y+ PGP=+++
t? 5? !X R? tv-- b+@ DI D+ G-- e++>+++ h-->++ !r y?
--END GEEK CODE BLOCK--


signature.asc
Description: Digital signature


Please help me optimize a MySQL server.

2004-05-19 Thread Mohammed Sameer
Hi,
I'm running a MySQL server on a duel P III 1G, with 2 GB RAM.
MySQL 4.0.18 compiled from source.

We have 2 webservers running apache, And this is the backend database server.
The server is really slow.
a select on a table with 138,247 rows takes about 1.6 - 2+ seconds, I have about 50% 
CPU idle.

using MyISAM table types.

sure I can provide any statistics about the running server.
Do you think that switching to innodb'd help ? Is it a problem with Debian woody ??
Any suggestions are welcomed.

Many thanks!

-- 

-- Katoob Main Developer
Linux registered user #224950, ICQ #58475622
--
Don't send me any attachment in Micro$oft (.DOC, .PPT) format please
Read http://www.fsf.org/philosophy/no-word-attachments.html
Preferable attachments: .PDF, .HTML, .TXT
Thanx for adding this text to Your signature
--
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT d-(++)@ s+(++):->+++ a-- C+++$> UL+++$> P+++$>+
L+++()$>+ E>+++ W++?>$ N+>+++ o? K-? !w++ !O !M !V !PS@ !PE@ Y+ PGP=+++
t? 5? !X R? tv-- b+@ DI D+ G-- e++>+++ h-->++ !r y?
--END GEEK CODE BLOCK--


signature.asc
Description: Digital signature


Re: Apache + php + MYSQL

2002-05-22 Thread Sameer Maggon

Hi,
  How do i check whether PHP has MYsql support built or not

  Please help
  Sameer

--
you wrote:

On Tuesday 21 May 2002 09:51, Robert Vetter wrote:
> On Tuesday 21 May 2002 10:38, Sameer Maggon wrote:
> in /var/www/html/rcmms/appl.php on line 5
>
> Hello,
>
> 1. make shure the PHP module is compiled into Apache, or runs as 
CGI.

rubbish, sorry. Make shure PHP is compiled with MySQL support.

Robert Vetter

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail 
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Apache + php + MYSQL

2002-05-20 Thread Sameer Maggon

Hi,
  I have my Database in MYSQL and wanna use PHP on Apache
  At the starting of the page I have given



 I says that mysql_connect 

 Fatal error: Call to undefined function: mysql_connect() 
in /var/www/html/rcmms/appl.php on line 5


 Please advice
 Sameer 





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Mysql Connection from Webserver

2002-05-20 Thread Sameer Maggon

Hi,
  I am using ASP and using IIS webserver..

  I have a Mysql server installed on a linux box.

  what is the connectstring that i have to use to connect and
  gather data from my Mysql server

  Sameer





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Binary Data mysql_real_escape_

2002-05-20 Thread Sameer Maggon

Hi,
  Please see the code given below::
  
  // 
  
  strcpy(query,"INSERT INTO blobtest VALUES('abc','");
  qptr = query;
  len = strlen(query);
  qptr += len;
  qptr += mysql_real_escape_string(&mysql, qptr, data, iBytesRead);
  *qptr += '\'';
  *qptr += ')';

  mysql_real_query(&mysql,query, (unsigned int)( qptr - query));
  printf("error = %s", mysql_error(&mysql));

  //

  It gives the error


 error = You have an error in your SQL syntax 
near ''ÿØÿà\0^PJFIF\0^A^A\0\0^
A\0^A\0\0ÿÛ\0C\0^H^F^F^G^F^E^H^G^G^G  
^H\n^L^T\r^L^K^K^L^Y^R^S^O^T^]\Z^_^^^]\Z^\^\ $.\' \'
 at line 1

  HWhat might be the problem
  Please help
  Sameer





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Re: store JPG in MySQL DB

2002-05-20 Thread Sameer Maggon

Hi,
  That explains me a problem but i could not see strmov()
  function any where, while linking with -lmysqlclient also
  it gives unreferenced function..

  I am using Mysql 3.23

  Please help 
  Sameer

--
you wrote:

Sameer,
Monday, May 20, 2002, 11:17:48 AM, you wrote:

SM>   Can you please put some light on it.. How i can do it, or is
SM>   it described in manual

You can insert file into BLOB field using INSERT statement and
retrieve file using SELECT.
To insert file you can use LOAD_FILE() function:
  http://www.mysql.com/doc/S/t/String_functions.html

In other cases don't forget to escape chars:
  http://www.mysql.com/doc/S/t/String_syntax.html

SM>   Sameer




-- 
For technical support contracts, goto https://order.mysql.com/?
ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail 
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




BLOB - JPG

2002-05-19 Thread Sameer Maggon

Hi,
  If i have a JPG file, how can i put it into the database
  / table in MYsql with one field defined as BLOB..

  Please help
  Sameer





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: store JPG in MySQL DB

2002-05-19 Thread Sameer Maggon

Hi,
  Can you please put some light on it.. How i can do it, or is
  it described in manual

  Sameer

--
you wrote:


Hi 
> Hi,
>   Can i have a table in which i can store my JPG file somehow in
>   MYSQL database.


Absolutely. 

just declare a BLOB column, and load your images rightinto the columsn

>   Sameer






--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




store JPG in MySQL DB

2002-05-19 Thread Sameer Maggon

Hi,
  Can i have a table in which i can store my JPG file somehow in
  MYSQL database.

  like i can do it in Oracle

  Sameer







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: query - primary key

2002-05-19 Thread Sameer Maggon

Hi,
  
  Firstly, how do i correct that error of BAD text coz i actually
  have a text file which has a HISTORY dump from IE.
  
  Secondly what about the Duplicate Entry stuff, its comming for
  all the URLs why??

  Regards
  Sameer

--
you wrote:

I'd take a look at this error first; you seem to be passing bad query
text to mysql.

-- 
Dan Nelson
[EMAIL PROTECTED]







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: query - primary key

2002-05-19 Thread Sameer Maggon

Hi,
  Here are the errors i am getting

 You have an error in your SQL syntax 
near 'http://www.indianrail.gov.in/frame.html')
file://C:\\IIK\\for_you.html
')' at line 1
You have an error in your SQL syntax 
near 'http://www.cultureholidays.com/')file://C:\\IIK\\Tour_del.html
')' at line 1
You have an error in your SQL syntax 
near 'http://mapsofindia.com/maps/delhi/h3s0902.htm')
file://C:\\IIK\\Map_del.html
')' at line 1
Duplicate entry 'k6m1-2001-08-14-05:02:00-
http://media.admonitor.net/creatives.cgi?
F2183|1017|1|iframe|C18744|||_admonitor|10930|58872
' for key 1
Duplicate entry 'k6m1-2001-08-14-04:56:00-http://eshop.msn.com
' for key 1
Duplicate entry 'k6m1-2001-08-14-05:02:00-
http://www.radiofreevirgin.com/asx/indierock_28.asx
' for key 1
Duplicate entry 'k6m1-2001-08-16-10:00:00-
http://windowsmedia.com/mediaguide/default.asp
' for key 1
Duplicate entry 'k6m1-2001-08-13-08:00:00-
http://64.14.197.173/Lang/Main.asp?S=123456&SR=238977&R=[direct]
&lang=EN
' for key 1


Thanx
Sameer
--
you wrote:

paste in the full error message, and if you made 'id' a TINYINT
AUTO_INCREMENT, think very very carefully about the rage of a TINYINT.

-- 
Dan Nelson
[EMAIL PROTECTED]







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




query - primary key

2002-05-19 Thread Sameer Maggon

Hi, 
  I have a table with four colums
  
  id
  date
  time
  addr - varchar (used my sql C API)

  I want that when i add an entry, the PRIMARY KEY IS ALL OF THEM
  means that no entry should repeat.

  I used ALTER TABLE sss ADD PRIMARY KEY (all four field)

  but not when i add my things, after 104 items, it gives an
  error, DUPLICATE ENTRY
  I have checked the file, they are not duplicate
  What do i do
  

  Please help
  Sameer





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Please help - Inserting

2002-05-19 Thread Sameer Maggon

Hi,

I have a table in which i have a field of VARCHAR(255), i am picking
up URLs from a file and INSERTING into mysql table, i am using
MySQL C API, the problem is that file contains 6700 records and
it is just inserting few records like 100 or so, what may be the
probnlem

Please help
Sameer







--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Insert into Table

2002-05-19 Thread Sameer Maggon

Hi,

I have a table in which i have a field of VARCHAR(255), i am picking
up URLs from a file and INSERTING into mysql table, i am using
MySQL C API, the problem is that file contains 6700 records and
it is just inserting few records like 100 or so, what may be the
probnlem

Please help
Sameer





--
http://www.dypatil.edu For Better tomorrow

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problems Creating BDB Type Tables

2001-08-31 Thread sameer ranadive


Dear Sir,

We are developing supply chain management where we are using EJB and mysql as 

back end. We want to use transaction safe tables, but I tried 'show variables;' 

command to know about table support for mysql support. Only 'have_isam' is 'YES' 

all other are 'NO'. Does this means I didn't have support for all other tables ? 

If so, what should I do to use transaction - safe tables.

Details about mysql installation
OS: Windows-NT
mysql version: 3.23.37-debug for Win-95/Win-98

OS: Redhat Linux 6.2
mysql version: 3.23.38 for pc-linux-gnu

Please guide us for the same,

Thanks and Regards,

 




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php