Re: GEMINI Table Type

2001-09-11 Thread Henning Schroeder

At 11:03 11.09.01, you wrote:
  does MYSQL.COM has a table type same as GEMINI ( GEMINI

yes. MySQL contains support for BDB and InnoDB tables, that are
transaction-safe.


I don´t want to provoke any anger here, maybe i´m still too new on the list.

But actually, i´m a bit sick of the current state of the gemini dispute. I 
have the feeling that you can´t even say the g-word loud here

 From the description on the mysql.org website, gemini tables look pretty 
good. But that´s maybe because they are not so easy on describing the 
problems with their tables as mysql.com on their website (with innodb and 
bdb tables). Also, it looks just like marketing talk so i refuse to form an 
opinion from that.

So could somebody more enlightened than me please fix us up on the 
technological benefits/drawbacks on these table types?

Also, I would very much love to hear about these legal problems. mysql.com 
still says But the products they [NuSphere] have shipped are and continue 
to be in GPL violation.. Nusphere gives you an Gemini GPL Source 
download.  One of the two must be wrong :-))

I was about to type something to the effect please shake hands, stop 
sueing each other and live happily. but i see that i´m not clued enough 
about the situation to have a real opinion.

Is somebody?

Henning


-
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 Performance Problem with updates, bug?

2001-09-11 Thread Henning Schroeder

Hello,

it´s me again. For the new readers: mysql 3.23.41, ~50q/s, load jumps to 200.

If have been experimenting with the slow log to find out about these slow 
queries that are apparently locking too long. Much to my horror, I have 
lots of queries of this type popping up:


# Time: 21  Lock_time: 17  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999880284, votescast=1304, prevvote=-1 where 
uid=69860;
--
# Time: 20  Lock_time: 16  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999881577, votescast=937, prevvote=-213 
where uid=69196;
--
# Time: 20  Lock_time: 13  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999881605, numlogins=1 where uid=71386;
--
# Time: 20  Lock_time: 5  Rows_sent: 0  Rows_examined: 0
update users set gotmail=t where uid=6662;
--
# Time: 21  Lock_time: 9  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999886543, votescast=2871, prevvote=147 
where uid=38648;
--
# Time: 24  Lock_time: 20  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999889591, votescast=8334, prevvote=3 where 
uid=39933;
--
# Time: 20  Lock_time: 9  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=999899878, votescast=2525, prevvote=221 
where uid=53470;
--
# Time: 21  Lock_time: 7  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=99986, votescast=199, prevvote=-7 where 
uid=65997;
--
# Time: 28  Lock_time: 12  Rows_sent: 0  Rows_examined: 0
update users set lastlogin=00020, votescast=3395, prevvote=-161 
where uid=38648;

These times are _way_ too long. usually an update takes ~1msec on my system.

The table users has a primary index on uid and an index on lastlogin.

I just don´t understand it. The manual says, the timing starts after having 
aquired all locks. So all the DB has to do is a) find the row b) update it 
c) maybe update the index on lastlogin d) release the locks.

How can this take 20+ seconds? (20+ seconds that the user table is 
completely locked, of course, what makes it clear that everything comes to 
a halt).

Above happens in a ~15 load condition. Or is the cause for it. Now that 
i´ve told apache to spawn no more than 60 children, the load doesn´t go up 
to 200 anymore, because everybody is just waiting instead of issuing new 
queries (what is not really a solution)

So again: how can an update with all tables already locked take longer that 
a blink of the eye? If this is a bug (and otherwise as well) i would be 
happy to report all details (again).


Waiting for enlightenment (_not_ the window manager),

Henning


-
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: load level on linux mysql server out of control

2001-09-10 Thread Henning Schroeder

At 01:46 11.09.01, you wrote:


I'm having a lot of trouble tracing the origin of the problem --
sometimes it seems that accessing a particular large table is causing
it, sometimes it seems that a combination of factors is causing it.
Regardless, what I observe is that within 1 minute my load level climbs
from between 2 and 4 to over 100, which I have never seen on any *nix
system before.   The RAM utilization is high, but not over 85%, and the
CPU utilization fluctuates of course but stays below 40% user until
whatever is causing my problems happens, and then it jumps to 100% and
doesn't come down until I kill mysqld and let everything close.


hi,

same problem here. mysql 3.23.41, apache 1.3.20, php 4.0.6, kernel 2.2.19, 
debian system. 1GHz PIII 512MB. load 200. my fix for now till i have a 
better idea is to restrict the number of apache children to 60 which keeps 
the load 20. which is horrible nevertheless. and extremely slow for the 
users at times. the load normalizes (to something 4-ish, which is still 
pretty high for ~50q/s) again after ~15min.

if you find out anything about that problem, PLEASE tell me. i´m searching 
for ~3 weeks and i´m not smarter in the least. and it sucks :-(

at least i didn´t have that harddisk failures. yet. but then, it´s a colo 
machine so power should be fine.

yes, dear mailing list, i know you told me my queries are, well, 
suboptimal. but i´m not quite sure about that. more tomorrow:-)


greetings
henning






-
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: Sorry if this is a duplicate got a failure notice back: SQL basica question again

2001-09-07 Thread Henning Schroeder

At 06:44 07.09.01, you wrote:
here is my sql query

SELECT COUNT(*) as count, hostname FROM host_list GROUP BY hostname ORDER BY
count DESC


what I would like to do is list say just the hosts that have greater then 10
in the left column


use the HAVING statement as in:

SELECT COUNT(*) as count, hostname FROM host_list GROUP BY hostname ORDER 
BY count DESC HAVING count10

hand
henning schroeder



-
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: MySQL Performance Problem

2001-09-06 Thread Henning Schroeder

hi wesley and the gang,

thank you very much for your help so far. i optimized the indexes and added 
another one i obviously forgot before, and the database is smoother now. a 
bit at least, it now maxes out at 65q/s instead of 50...

At 13:12 06.09.01, you wrote:

  idea? And how am I supposed to find the slow queries?

Find all the queries that interact with this table. EXPLAIN them. Time them.

*all* of them? there are lots. as said before, it is the main user table. a 
user account is updated every time somebody request a page. and i need to 
join to that table very often to find out, when the corresponding user 
logged in last and what his name is. bad design? bad idea? what do you think?

i could split these queries below into multiple queries, first getting the 
userid and then firing off another query to get the name (without a join). 
but i thought letting the database handle this should be faster.


  select * from cookies left join users on cookies.uid=users.uid left join
  sessions on users.uid=sessions.uid where
  cookies.cookie=e3bd03382561eb3619b66fbea2af217d;
 
  select * from cookies left join users on cookies.uid=users.uid left join
  extended on  users.uid=extended.uid where
  cookies.cookie=5226220e3b62cef71a13524ec7a413ac;
 
  (above queries have to be performed at the beginning of every webpage to
  find the current user. i don´t really think they are slow; they just lock
  because of something else.)
 
  i just tried the above query ten times. result: 7x 0.00sec, 1x0.01, 
 1x0.02,
  1x0.04. does that spell slow?

Yes. I wouldn't let queries with times like these near a busy production
server I was responsible for unless I was positive they wouldn't and couldn't
happen more than a handful of times a day. :-)

Post the output of EXPLAIN for these queries. Along with the create defns
for these other tables.

mysql explain select * from cookies left join users on 
cookies.uid=users.uid left join extended on users.uid=extended.uid where 
cookies.cookie=ee33c9ec7950a1e5c39f37bf72d2de51;
+--+---+---+-+-+---+--+---+
| table| type  | possible_keys | key | key_len | ref   | rows | Extra |
+--+---+---+-+-+---+--+---+
| cookies  | const | PRIMARY   | PRIMARY |  32 | const |1 |   |
| users| const | PRIMARY   | PRIMARY |   4 | const |1 |   |
| extended | const | PRIMARY   | PRIMARY |   3 | const |1 |   |
+--+---+---+-+-+---+--+---+
3 rows in set (3.35 sec)

mysql explain select * from cookies left join users on 
cookies.uid=users.uid left join sessions on users.uid=sessions.uid where 
cookies.cookie=5c50d7a7319ae6c8529f535aa5f19109;
+--+---+---+-+-+---+--+---+
| table| type  | possible_keys | key | key_len | ref   | rows | Extra |
+--+---+---+-+-+---+--+---+
| cookies  | const | PRIMARY   | PRIMARY |  32 | const |1 |   |
| users| const | PRIMARY   | PRIMARY |   4 | const |1 |   |
| sessions | const | PRIMARY   | PRIMARY |   4 | const |1 |   |
+--+---+---+-+-+---+--+---+
3 rows in set (4.55 sec)

doesn´t look too bad for me. except that timing information at the end :-(. 
but that´s because the database is almost completely locked up again 
(processlist full of queries with Locked status).

the table definition is quite long, i´ll append it to the end of the mail.

On a busy database (thousands of queries per second), it doesn't take
long for the whole database to get totally bogged down if a massive
web of blocks happens like this. And mysqld doesn't always recover.

well, yes. i noticed that :-(. thank you for your good explanation though. 
but i think it´s probably not very fruitful to look for queries in the 
processlist that have locked status, because they are probably not the 
slow ones that caused the block. am i correct?

Banning queries that take longer than 0.00 seconds at the mysql prompt
(run them a few times - one or two 0.00s and it's suspect) is just
a handy rule of thumb for measuring nastiness of queries. For proper
measurements, one could benchmark queries - or one could stick a unique
comment into every query and just watch processlists. You will come to
recognise the common  slow queries because you will see them in the
processlists often!

i also tried logging the queries that appear often with copying to temp 
table status and now have a nice set of them, though i don´t quite 
understand *why* the are copying. below are two:
(the rows count is *way* to high, probably because the timestamps are 
ancient by the time i ran explain select)

  select count(*) from adviews where click=f and uid=7618 and cid=11 and 
datestamp=999782664

mysql explain  

finding out about mysql locks

2001-09-06 Thread Henning Schroeder

Hi!

Is there a way or command for mysql that shows me

a) what tables are currently locked
b) with what kind of lock
c) which query caused the lock
d) and maybe how long the lock exists?

I usually try to figure out via mysqladmin processlist and look for the one 
query that isn´t locked as the cause, but sometimes it just seems like 
everything is locked.

henning


-
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: MySQL Performance Problem

2001-09-06 Thread Henning Schroeder

At 17:52 06.09.01, you wrote:

It is copying ALL of the results into the temp table.  If you can (e.g. 
you know you will
never want more than N records), add a LIMIT 0,N to the end of the SELECT 
so that when you
have an old timestamp it will not hang the database.


as i use

select count (*) from blah where blahblah;

(actually i am just interested whether there is a row or not matching the 
criterion. under normal operations there should never be more than one match)

i don´t understand how a limit 0,1 would help here. wouldn´t it just say 
that no more than one count(*) result should be returned (which never the 
case anyway because count(*) returns exactly one row)?

henning



-
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: How to do simple stuff

2001-09-06 Thread Henning Schroeder

At 17:25 06.09.01, you wrote:
Or ENUM:
ALTER TABLE myTable CHANGE COLUM myColumn ENUM( 'T', 'F' );

Of course if you are using this to drive a web page Mike's solution is better.
  Or you would want to enum( 1, 0 ) or enum( '1', '' );


yes, but do *not* use enum('t','f') because with some fonts they are not 
easily distinguised. it is not very funny to find the one f within a 
column of 30 ts. :-)

and think about clever defaults here.

henning



-
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: Recursive same-table lookup, operator precedence (?)

2001-09-06 Thread Henning Schroeder

At 22:53 06.09.01, you wrote:


mysql SELECT receiver_id, associate_of, user_name FROM receivers;
+-+--+-+
| receiver_id | associate_of | user_name   |
+-+--+-+
|   1 |0 | arnold  |
|   2 |0 | barney  |
|   3 |0 | cecilia |
|   4 |2 | diana   |
|   5 |2 | elmer   |
|   6 |3 | fred|
+-+--+-+
6 rows in set (0.00 sec)

It is a recursive table design, meaning that a person can have a boss. The 
boss' id is stored in the associate_of column. Eg. elmer is barney's 
associate, barney is boss of elmer, and diana

Let's say I only know the user_name 'barney', and I would like to select 
all his associates.

mysql does not support sub-selects, thus you have to write it using a join 
with the same table twice, something like (untested, out of my head);

select person.receiver_id, person.associate_of, person.user_name from 
receivers as person, receivers as boss where boss.user_name='barney' and 
person.associate_of=boss.receiver_id;

this should return you diana and elmer, but not barney, because he is not 
his boss.

hth,
henning



-
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 Performance Problem

2001-09-05 Thread Henning Schroeder

Hi!

I am trying to understand and fix a severe performance problem I am having 
with MySQL for some weeks now, but to no avail. So I am coming here, hoping 
you understand more than I do (which is not very hard to do :-)

Im am running mysql 3.23.41 (from the mysql-server-3.23.41-1 debian 
package) on a linux 2.2.19pre17 system with 512MB RAM and an 1GHz Pentium 
III Processor together witch apache 1.3.20 and php4.0.6.

Every requested page required a mysql connection and does on the average 5 
queries. Most, if not all of the system processing resources are being used 
by the various mysld demons that fork; the apache/php workload is less than 
1% of total CPU (i use apc for php caching).

Currently, mysql maxes out at about 50 queries per second, which translates 
to a system load of about 8. I have restricted apache to start a maximum of 
60 httpds, if I leave apache at the standard setting of 150 servers, the 
system load jumps to about 200 (!) and everything grinds to a complete halt 
for maybe half an hour.

Of course, I would like to have more users concurrently accessing the 
system. To my understanding, mysql should be able to handle 1000 req/sec on 
that kind of machine easily.

Looking in the process table reveals (when the page is fast) lots of 
sleeping processes, sometimes (when the page is slow -- 30sec to load a web 
page) lots (20+) processes that are locked. Usually they are some SELECTs 
and UPDATEswaiting for a single table that is the most update intensive 
(one update per web page served,  changing one to three columns in one row 
that is indexed by a primary key). The complete DB size 380MB, the problem 
table is 4MB large.

I tried changing every parameter that I could think of. Now I am absolutely 
stuck. Or am I wrong in thinking that my machine should be fast enough for 
that kind of application?

I have included below all diagnostic output i could think of; if you need 
more please ask.

Thank you very much for your help in advance
Henning Schroeder

--- variables -

+-+-
| Variable_name   | 
Value 
+-+-
| back_log| 50
| basedir | /usr/
| bdb_cache_size  | 8388600
| bdb_log_buffer_size | 262144
| bdb_home| /var/lib/mysql/
| bdb_max_lock| 1
| bdb_logdir  |
| bdb_shared_data | OFF
| bdb_tmpdir  | /tmp/
| bdb_version | Sleepycat Software: Berkeley DB 3.2.9a: 
(August 11, 2001)
| binlog_cache_size   | 32768
| character_set   | latin1
| character_sets  | latin1 big5 cp1251 cp1257 croat czech 
danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 
hungarian koi8_ru koi8_ukr latin2 latin5 swe7 usa7 win1250 win1251 
win1251ukr ujis sjis tis620
| concurrent_insert   | ON
| connect_timeout | 5
| datadir | /var/lib/mysql/
| delay_key_write | ON
| delayed_insert_limit| 100
| delayed_insert_timeout  | 300
| delayed_queue_size  | 1000
| flush   | OFF
| flush_time  | 0
| have_bdb| YES
| have_gemini | NO
| have_innodb | DISABLED
| have_isam   | YES
| have_raid   | YES
| have_ssl| NO
| init_file   |
| innodb_data_file_path   |
| innodb_data_home_dir|
| innodb_flush_log_at_trx_commit  | OFF
| innodb_log_arch_dir |
| innodb_log_archive  | OFF
| innodb_log_group_home_dir   |
| innodb_flush_method |
| interactive_timeout | 28800
| join_buffer_size| 131072
| key_buffer_size | 134213632
| language| /usr/share/mysql/english/
| large_files_support | ON
| locked_in_memory| OFF
| log | OFF
| log_update  | OFF
| log_bin | OFF
| log_slave_updates   | OFF
| log_long_queries| ON
| long_query_time | 10
| low_priority_updates| OFF
| lower_case_table_names  | 0
| max_allowed_packet  | 1047552
| max_binlog_cache_size   | 4294967295
| max_binlog_size | 1073741824
| max_connections | 200
| max_connect_errors  | 10
| max_delayed_threads | 20
| max_heap_table_size | 16777216
| max_join_size   | 4294967295
| max_sort_length | 1024
| max_user_connections| 0

Re: MySQL Performance Problem

2001-09-05 Thread Henning Schroeder

Hi,

  Looking in the process table reveals (when the page is fast) lots of
  sleeping processes, sometimes (when the page is slow -- 30sec to load a 
 web
  page) lots (20+) processes that are locked. Usually they are some SELECTs
  and UPDATEswaiting for a single table that is the most update intensive
  (one update per web page served,  changing one to three columns in one row
  that is indexed by a primary key). The complete DB size 380MB, the 
 problem
  table is 4MB large.

Focus on this table. Specifically on the queries that access this table.
At least one query is much slower than it needs to be. Post the create
description of the table. Post some of the queries that block on this
table. If you can, find the query or queries that are slow on this table.
Optimise them.

All the updates to the table are of the style described above (one to three 
colums changed, row indexed by primary key). Well, with SELECTs it´s a 
different story: many queries join in different ways to the table. FYI, 
it´s the table where all user information is stored, so I need a join every 
time I need e.g. to find the name corresponding to an userid. Is that a bad 
idea? And how am I supposed to find the slow queries?

It might be as simple as the table having a varchar column being compared
numerically (without quotes). It might be as simple as needing an index to
that table.

I wish. The table is constant-row-length (no variable colums) and indexed 
on the important fields.

I`m not quite sure whether it is really a contention problem. A standard 
query takes about 0.2msec on this computer (own benchmark); even if slow 
queries took 20ms and all queries where slow queries, the system should 
nevertheless be able to answer 50 queries/sec.

If it was a contention problem, I could switch to another table type. Would 
that help? What do you think?

TIA,
henning



--- create description follows ---

#
# Table structure for table 'users'
#

CREATE TABLE users (
uid int(11) NOT NULL auto_increment,
active enum('f','t') DEFAULT 't' NOT NULL,
lastlogin int(11) DEFAULT '0' NOT NULL,
sex enum('unbekannt','mann','frau') DEFAULT 'unbekannt' NOT NULL,
isuser enum('gast','user') DEFAULT 'gast' NOT NULL,
ratewhat enum('beides','mann','frau') DEFAULT 'beides' NOT NULL,
numlogins mediumint(9) DEFAULT '0' NOT NULL,
votescast mediumint(9) DEFAULT '0' NOT NULL,
username char(20) NOT NULL,
offline enum('f','t') DEFAULT 'f' NOT NULL,
perstopre enum('f','t') DEFAULT 'f' NOT NULL,
gotmail enum('f','t') DEFAULT 'f' NOT NULL,
prevvote smallint(6) DEFAULT '0' NOT NULL,
forumfloat enum('f','t') DEFAULT 't' NOT NULL,
nested enum('f','t') DEFAULT 'f' NOT NULL,
msgperpage tinyint(3) unsigned DEFAULT '20' NOT NULL,
newfirst enum('f','t') DEFAULT 'f' NOT NULL,
adm 
set('stats','banner','bilder','foren','uinfo','nobanner','matchmaking','db','chat','mails')
 
NOT NULL,
getmails enum('f','t') DEFAULT 't' NOT NULL,
firstlogin int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY username (username)
);

-- the two types of slow queries (from the slow log) 
-

Type I:

select * from cookies left join users on cookies.uid=users.uid left join 
sessions on users.uid=sessions.uid where 
cookies.cookie=e3bd03382561eb3619b66fbea2af217d;

select * from cookies left join users on cookies.uid=users.uid left join 
extended on  users.uid=extended.uid where 
cookies.cookie=5226220e3b62cef71a13524ec7a413ac;

(above queries have to be performed at the beginning of every webpage to 
find the current user. i don´t really think they are slow; they just lock 
because of something else.)

i just tried the above query ten times. result: 7x 0.00sec, 1x0.01, 1x0.02, 
1x0.04. does that spell slow?



Type II:

update users set lastlogin=999697993, perstopre=f where uid=40651;

update users set lastlogin=999698763, votescast=1514, prevvote=-8 where 
uid=54307;

(the usual locked queries)




-
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: limit and order by issuse

2001-09-05 Thread Henning Schroeder


sh Here is my query:

sh SELECT
sh articleId,arttitle,artsourceId,artstatus,artauthorId,arteventdate,artpre
sh ss,artpageno,artrankId,artabstract,
sh artfulltext,artisdisplay,arteditionId,arttypeid,artsubjectid ,
sh asubjectId,asubjectname , FLOOR((TO_DAYS(CURRENT_DATE()) -
sh TO_DAYS(arteventdate))/365.25) as dif , atypeId, atypename, authorId,
sh autname , sourceId, srcname ,usrfname ,usrlname from article ,asubject
sh ,atype ,author, source left join user on user.userId = article.user
sh where artstatus!='N' and artsourceId = sourceId and authorId =
sh artauthorId and arttypeid = atypeId and asubjectId=artsubjectid and
sh artauthorid=145 order by articleId desc limit 1 , 20


sh -  When my application in php is getting data from mysql it gets some
sh rows. And show no error. [ mysql_error()  show no error]

sh -  When I run same query on phpmyadmin query prompt, it gives an error
sh with no description.

Technically there should be no big difference running the query in
php or phpmyadmin, so I don't understand why this would return
different answers.

Yes there is, and it has caused me some grief a while ago. phpmyadmin (at 
least my installation) seems to add limit 0,30 to every select query you 
enter into the input field. i think this is to make sure that the result 
page is not extremely long. anyway, one *cannot* enter limit clauses in a 
phpmyadmin query. yes, it sucks.

henning schroeder.



-
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 Help

2001-09-05 Thread Henning Schroeder

At 01:10 06.09.01, you wrote:
Hello All,

I got a sql query I seemed to be missing the obvious or just can't see.
Database Table structure:
CREATE TABLE `membership` (
   `tagid` int(8) NOT NULL default '0',
   `startdate` date NOT NULL default '-00-00',
   `expdate` date NOT NULL default '-00-00',
   `days` smallint(4) NOT NULL default '0',
   PRIMARY KEY  (`tagid`),
   KEY `days` (`days`)
)

CREATE TABLE `tags` (
   `tagid` int(8) NOT NULL auto_increment,
   `orderid` int(8) NOT NULL default '0',
   `finderid` int(8) NOT NULL default '0',
   `tagnumber` varchar(10) NOT NULL default '',
   PRIMARY KEY  (`tagid`),
   UNIQUE KEY `tagnumber` (`tagnumber`),
   KEY `orderid` (`orderid`,`finderid`)
);

What I need to do is extract all the tagnumbers,days and expdate where the
orderid equals the tagid in both the tags and membership tables.


okay,

extract all the tagnumbers,days and expdate

select tagnumber, days, expdate from membership, tags

where the orderid equals the tagid

where orderid=tags.tagid and tags.tagid=membership.id;


i´m not quite sure if I understood you correctly. above query gets you your 
data joining the tables together on identical tagids and selecting all rows 
where tags.tagid=tags.orderid. is that what you wanted? otherwise, ask...

greetings,
hgs



-
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: Mysqld Dead But Subsys Locked

2001-09-05 Thread Henning Schroeder



When I attempted to change the MySQL root user with the command mysqladmin
-u root -p password 'new-password'  I received the following error:
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock '(2)' check that mysqld is running and that the
socket; '/var/lib/mysql/mysql.sock' exists!
I checked the directory stated for the mysql.sock and it does exist, but
when checking the status of mysqld using 'service mysqld status' I received
the following: mysqld dead but subsys locked.

- delete the lock file (as root)
- restart mysql
- look at the logs (mysql.err)
- make sure the directory /var/lib/mysql/ has the right permissions!! 
(chmod o+rx /var/lib/mysql/).

hgs


-
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 Help

2001-09-05 Thread Henning Schroeder

At 02:58 06.09.01, you wrote:
I get the results:
Impossible WHERE noticed after reading const tables

Not sure this has anything to do with it, but there is no data in either table
yet,


yes, that´s exactly the reason. the query optimizer found out very early 
that your select would not return any rows and thus told you so. populate 
the tables with some data and try again.

hgs



-
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