Re: Problem with mysql

2010-01-11 Thread Jørn Dahl-Stamnes
On Monday 11 January 2010 08:53, Mihamina Rakotomandimby wrote:
  Jørn Dahl-Stamnes sq...@dahl-stamnes.net :
  I have checked the local DNS and 'r2-d2' and 'r2-d2.dahl-stamnes.net'
  resovl to the same IP-addresse.
  What's wrong?

 Reverse resolution?

I have checked that, and reverse DNS is OK - both resolve to 192.18.2.22

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

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



Re: mysqld occupies 100$ cpu

2010-01-11 Thread Ananda Kumar
what is your my.cnf setting.
Also did u check slowquery.log for any sql's not using index or not using
the right index.



On Mon, Jan 11, 2010 at 1:21 PM, F.A.I.Z.A.L sac.fai...@gmail.com wrote:

 Hi

 mysqld process taking high cpu utilization (100%), how to reduce the cup
 utilization

 it is running under solaris 8 with 16GB ram and 1 multicore cpu (2 core)

 anyone help please?

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com



Re: Problem with mysql

2010-01-11 Thread Ananda Kumar
use mysql;
select * from  user;

see if you able to see 'r2-d2' entry in this table.

also you can try this

grant all on . to 'root'@'%' idenfified by
'secret-password';

regards
anandkl
On Mon, Jan 11, 2010 at 1:40 PM, Jørn Dahl-Stamnes
sq...@dahl-stamnes.netwrote:

 On Monday 11 January 2010 08:53, Mihamina Rakotomandimby wrote:
   Jørn Dahl-Stamnes sq...@dahl-stamnes.net :
   I have checked the local DNS and 'r2-d2' and 'r2-d2.dahl-stamnes.net'
   resovl to the same IP-addresse.
   What's wrong?
 
  Reverse resolution?

 I have checked that, and reverse DNS is OK - both resolve to 192.18.2.22

 --
 Jørn Dahl-Stamnes
 homepage: http://www.dahl-stamnes.net/dahls/

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




Re: Problem with mysql

2010-01-11 Thread Jørn Dahl-Stamnes
On Monday 11 January 2010 09:55, Ananda Kumar wrote:
 use mysql;
 select * from  user;

 see if you able to see 'r2-d2' entry in this table.

 also you can try this

 grant all on . to 'root'@'%' idenfified by
 'secret-password';

I just found the cause of the problem... /etc/nsswitch.conf.

It said that files should be used before dns. After I changed the order, it 
worked (so did the strange sendmail problem I had).

But still I wonder why it worked on the other host, since it also had the 
order files dns in it's nsswitch.conf file...

Thanks for your support.

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

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



Re: mysqld occupies 100$ cpu

2010-01-11 Thread F.A.I.Z.A.L
Hi Kumar,

thanks for your reply.. here is my my.cnf file. i don't see anything here.
what is this slowquery.log?, where it will be?
---
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
-
Cheers
Faizal S
GSM : 9840118673
Blog: http://oradbapro.blogspot.com


On Mon, Jan 11, 2010 at 2:17 PM, Ananda Kumar anan...@gmail.com wrote:

 what is your my.cnf setting.
 Also did u check slowquery.log for any sql's not using index or not using
 the right index.



 On Mon, Jan 11, 2010 at 1:21 PM, F.A.I.Z.A.L sac.fai...@gmail.com wrote:

 Hi

 mysqld process taking high cpu utilization (100%), how to reduce the cup
 utilization

 it is running under solaris 8 with 16GB ram and 1 multicore cpu (2 core)

 anyone help please?

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com





Re: mysqld occupies 100$ cpu

2010-01-11 Thread Ananda Kumar
looks like u have not setup slow query log parameter.

If this is a non-production db, shut it down and add this parameter, unser
[mysqld]

log-slow-queries = /var/lib/slowqueries.log.

Or execute
SHOW ENGINE  STATUS\G;
You will get to know what all activities are going on ur db and check if
there is any IO contention happening




On Mon, Jan 11, 2010 at 2:47 PM, F.A.I.Z.A.L sac.fai...@gmail.com wrote:

 Hi Kumar,

 thanks for your reply.. here is my my.cnf file. i don't see anything here.
 what is this slowquery.log?, where it will be?
 ---
 [mysqld]
 datadir=/var/lib/mysql
 socket=/var/lib/mysql/mysql.sock
 # Default to using old password format for compatibility with mysql 3.x
 # clients (those using the mysqlclient10 compatibility package).
 old_passwords=1

 [mysql.server]
 user=mysql
 basedir=/var/lib

 [mysqld_safe]
 log-error=/var/log/mysqld.log
 pid-file=/var/run/mysqld/mysqld.pid
 -

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com


   On Mon, Jan 11, 2010 at 2:17 PM, Ananda Kumar anan...@gmail.com wrote:

 what is your my.cnf setting.
 Also did u check slowquery.log for any sql's not using index or not using
 the right index.



 On Mon, Jan 11, 2010 at 1:21 PM, F.A.I.Z.A.L sac.fai...@gmail.comwrote:

 Hi

 mysqld process taking high cpu utilization (100%), how to reduce the cup
 utilization

 it is running under solaris 8 with 16GB ram and 1 multicore cpu (2 core)

 anyone help please?

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com






Re: mysqld occupies 100$ cpu

2010-01-11 Thread F.A.I.Z.A.L
i try this
mysql SHOW ENGINE STATUS\G;
ERROR 1286 (42000): Unknown table engine 'STATUS'
ERROR:
No query specified

after setting the parameter in my.cnf which u provided. it is not showing

mysql show engine status;
ERROR 1286 (42000): Unknown table engine 'status'

what i have to do now?

Cheers
Faizal S
GSM : 9840118673
Blog: http://oradbapro.blogspot.com


On Mon, Jan 11, 2010 at 3:27 PM, Ananda Kumar anan...@gmail.com wrote:

 looks like u have not setup slow query log parameter.

 If this is a non-production db, shut it down and add this parameter, unser
 [mysqld]

 log-slow-queries = /var/lib/slowqueries.log.

 Or execute
 SHOW ENGINE  STATUS\G;
 You will get to know what all activities are going on ur db and check if
 there is any IO contention happening




 On Mon, Jan 11, 2010 at 2:47 PM, F.A.I.Z.A.L sac.fai...@gmail.com wrote:

 Hi Kumar,

 thanks for your reply.. here is my my.cnf file. i don't see anything here.
 what is this slowquery.log?, where it will be?
 ---
 [mysqld]
 datadir=/var/lib/mysql
 socket=/var/lib/mysql/mysql.sock
 # Default to using old password format for compatibility with mysql 3.x
 # clients (those using the mysqlclient10 compatibility package).
 old_passwords=1

 [mysql.server]
 user=mysql
 basedir=/var/lib

 [mysqld_safe]
 log-error=/var/log/mysqld.log
 pid-file=/var/run/mysqld/mysqld.pid
 -

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com


   On Mon, Jan 11, 2010 at 2:17 PM, Ananda Kumar anan...@gmail.comwrote:

 what is your my.cnf setting.
 Also did u check slowquery.log for any sql's not using index or not using
 the right index.



 On Mon, Jan 11, 2010 at 1:21 PM, F.A.I.Z.A.L sac.fai...@gmail.comwrote:

 Hi

 mysqld process taking high cpu utilization (100%), how to reduce the cup
 utilization

 it is running under solaris 8 with 16GB ram and 1 multicore cpu (2 core)

 anyone help please?

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com







Re: mysqld occupies 100$ cpu

2010-01-11 Thread Ananda Kumar
SHOW ENGINE innodb STATUS\G

On Mon, Jan 11, 2010 at 3:35 PM, F.A.I.Z.A.L sac.fai...@gmail.com wrote:

 i try this
 mysql SHOW ENGINE STATUS\G;
 ERROR 1286 (42000): Unknown table engine 'STATUS'
 ERROR:
 No query specified

 after setting the parameter in my.cnf which u provided. it is not showing

 mysql show engine status;
 ERROR 1286 (42000): Unknown table engine 'status'

 what i have to do now?


 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com


   On Mon, Jan 11, 2010 at 3:27 PM, Ananda Kumar anan...@gmail.com wrote:

 looks like u have not setup slow query log parameter.

 If this is a non-production db, shut it down and add this parameter, unser
 [mysqld]

 log-slow-queries = /var/lib/slowqueries.log.

 Or execute
 SHOW ENGINE  STATUS\G;
 You will get to know what all activities are going on ur db and check if
 there is any IO contention happening




 On Mon, Jan 11, 2010 at 2:47 PM, F.A.I.Z.A.L sac.fai...@gmail.comwrote:

 Hi Kumar,

 thanks for your reply.. here is my my.cnf file. i don't see anything
 here. what is this slowquery.log?, where it will be?
 ---
 [mysqld]
 datadir=/var/lib/mysql
 socket=/var/lib/mysql/mysql.sock
 # Default to using old password format for compatibility with mysql 3.x
 # clients (those using the mysqlclient10 compatibility package).
 old_passwords=1

 [mysql.server]
 user=mysql
 basedir=/var/lib

 [mysqld_safe]
 log-error=/var/log/mysqld.log
 pid-file=/var/run/mysqld/mysqld.pid
 -

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com


   On Mon, Jan 11, 2010 at 2:17 PM, Ananda Kumar anan...@gmail.comwrote:

 what is your my.cnf setting.
 Also did u check slowquery.log for any sql's not using index or not
 using the right index.



 On Mon, Jan 11, 2010 at 1:21 PM, F.A.I.Z.A.L sac.fai...@gmail.comwrote:

 Hi

 mysqld process taking high cpu utilization (100%), how to reduce the
 cup
 utilization

 it is running under solaris 8 with 16GB ram and 1 multicore cpu (2
 core)

 anyone help please?

 Cheers
 Faizal S
 GSM : 9840118673
 Blog: http://oradbapro.blogspot.com








Re: Problem with mysql

2010-01-11 Thread Mihamina Rakotomandimby
 Jørn Dahl-Stamnes sq...@dahl-stamnes.net :
   I have checked the local DNS and 'r2-d2' and
   'r2-d2.dahl-stamnes.net' resovl to the same IP-addresse.
   What's wrong?
  Reverse resolution?
 I have checked that, and reverse DNS is OK - both resolve to
 192.18.2.22

I read you solved your problem, but by reverse I meant what
r2-d2.dahl-stamnes.net resolves to.

-- 
   Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche  Developpement
+261 34 29 155 34 / +261 33 11 207 36

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



Re: Problem with mysql

2010-01-11 Thread Mihamina Rakotomandimby
(Correction, seel below)

 Jørn Dahl-Stamnes sq...@dahl-stamnes.net :
   I have checked the local DNS and 'r2-d2' and
   'r2-d2.dahl-stamnes.net' resovl to the same IP-addresse.
   What's wrong?
  Reverse resolution?
 I have checked that, and reverse DNS is OK - both resolve to
 192.18.2.22

I read you solved your problem, but by reverse I meant what
r2-d2.dahl-stamnes.net resolves to.

Sorry (...) what 192.18.2.22 resolves to.

-- 
   Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche  Developpement
+261 34 29 155 34 / +261 33 11 207 36

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



Re: Problem with mysql

2010-01-11 Thread Jørn Dahl-Stamnes
On Monday 11 January 2010 12:33, Mihamina Rakotomandimby wrote:
 (Correction, seel below)

  Jørn Dahl-Stamnes sq...@dahl-stamnes.net :
I have checked the local DNS and 'r2-d2' and
'r2-d2.dahl-stamnes.net' resovl to the same IP-addresse.
What's wrong?
  
   Reverse resolution?
 
  I have checked that, and reverse DNS is OK - both resolve to
  192.18.2.22

 I read you solved your problem, but by reverse I meant what
 r2-d2.dahl-stamnes.net resolves to.

 Sorry (...) what 192.18.2.22 resolves to.

it resolv to r2-d2.dahl-stamnes.net

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

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



Re: Probability Selects

2010-01-11 Thread Baron Schwartz
Matt,

On Thu, Jan 7, 2010 at 3:10 PM, Matt Neimeyer m...@neimeyer.org wrote:
 What's the best way to select names at random from this but still take
 into account frequency of use?

Here's the link I usually send clients:
http://jan.kneschke.de/projects/mysql/order-by-rand/

-- 
Baron Schwartz
Percona Inc: Services and Support for MySQL
http://www.percona.com/

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



Re: tmp tables

2010-01-11 Thread Baron Schwartz
Victor,

On Sun, Jan 10, 2010 at 1:20 PM, Victor Subervi victorsube...@gmail.com wrote:
 Hi;
 I have a shopping cart that will spawn a tmp table for every shopping cart
 instance. Would it be better to create a separate database for these instead
 of having them in the same database as all the other tables for the shopping
 cart?

It will not matter at all.  But it would be better to choose a
different design.  Instead of adding a table per cart, just create a
table and add a row(s) to it for every cart.  This is what relational
databases were designed for :-)

Regards
Baron

-- 
Baron Schwartz
Percona Inc: Services and Support for MySQL
http://www.percona.com/

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



Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 10:35 AM, Baron Schwartz ba...@xaprb.com wrote:

 Victor,

 On Sun, Jan 10, 2010 at 1:20 PM, Victor Subervi victorsube...@gmail.com
 wrote:
  Hi;
  I have a shopping cart that will spawn a tmp table for every shopping
 cart
  instance. Would it be better to create a separate database for these
 instead
  of having them in the same database as all the other tables for the
 shopping
  cart?

 It will not matter at all.  But it would be better to choose a
 different design.  Instead of adding a table per cart, just create a
 table and add a row(s) to it for every cart.  This is what relational
 databases were designed for :-)


That strikes me as messy. Each tmp table has as many rows as necessary for
the products that are to be bough. To do as you say I would have to create a
table with a zillion rows to accommodate however many products I *predict*
buyers would buy. Therefore, I guess I should probably create a new database
so as to not make a mess of the main database.
TIA,
V


Re: tmp tables

2010-01-11 Thread Baron Schwartz
Victor,

 That strikes me as messy. Each tmp table has as many rows as necessary for
 the products that are to be bough. To do as you say I would have to create a
 table with a zillion rows to accommodate however many products I *predict*
 buyers would buy. Therefore, I guess I should probably create a new database
 so as to not make a mess of the main database.

You fundamentally misunderstand relational database design.  I suggest
reading this book:
http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/

Regards,
Baron

-- 
Baron Schwartz
Percona Inc: Services and Support for MySQL
http://www.percona.com/

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



Re: Probability Selects

2010-01-11 Thread Johan De Meersman
I think what he's trying to accomplish is not truly random, but to use the
probability that's indicated in the second field of the table:

1, Aaron, 0.240
 3, Abe, 0.006
 13, Adrian, 0.069


So there would be a probability of 0.240 that the call returns Aaron, a
probability of 0.006 that it returns Abe, and so on.

I've no clue how to do this in SQL, though, save for the utter stupidity of
creating a table that repeats each name (or UID, saves memory/disk)
1000*probability times, and do a random select on that (or 100* or 10*
depending on how precise you need it). I'd not recommend it, though - it's
gonna be a mess and a huge performance drain.

I suspect this would be better done in code, but I've been out of coding (or
statistics) for too long to give pointers there.


On Mon, Jan 11, 2010 at 3:31 PM, Baron Schwartz ba...@xaprb.com wrote:

 Matt,

 On Thu, Jan 7, 2010 at 3:10 PM, Matt Neimeyer m...@neimeyer.org wrote:
  What's the best way to select names at random from this but still take
  into account frequency of use?

 Here's the link I usually send clients:
 http://jan.kneschke.de/projects/mysql/order-by-rand/

 --
 Baron Schwartz
 Percona Inc: Services and Support for MySQL
 http://www.percona.com/

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




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


Binary log problems

2010-01-11 Thread Jørn Dahl-Stamnes
I tried to look at the binary logs by using phpMyAdmin, but got an error:

SQL error:
SHOW BINLOG EVENTS LIMIT 0, 30;

MySQL said:
#1220 - Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O 
error.

From the error-file:

100111 16:15:40 [ERROR] Error in Log_event::read_log_event(): 'Found invalid 
event in binary log', data_len: 100, event_type: 2
100111 16:16:51 [ERROR] Error in Log_event::read_log_event(): 'Found invalid 
event in binary log', data_len: 100, event_type: 2
100111 16:17:08 [ERROR] Error in Log_event::read_log_event(): 'Found invalid 
event in binary log', data_len: 100, event_type: 2

What is causing this? How can I fix this?

I'm using version mySQL 5.1.42.

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/

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



Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz ba...@xaprb.com wrote:

 Victor,

  That strikes me as messy. Each tmp table has as many rows as necessary
 for
  the products that are to be bough. To do as you say I would have to
 create a
  table with a zillion rows to accommodate however many products I
 *predict*
  buyers would buy. Therefore, I guess I should probably create a new
 database
  so as to not make a mess of the main database.

 You fundamentally misunderstand relational database design.  I suggest
 reading this book:

 http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/


LOL. Ok, I'll put it on my list. *In the meantime*, since I am reworking my
database design for the shopping cart I just finished building and need to
get this up __n_o_w__, what would your advice be?
V


 Regards,
 Baron

 --
 Baron Schwartz
 Percona Inc: Services and Support for MySQL
 http://www.percona.com/




-- 
The Logos has come to bear
http://logos.13gems.com/


RE: mysqld occupies 100$ cpu

2010-01-11 Thread Jerry Schwartz
Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com

-Original Message-
From: F.A.I.Z.A.L [mailto:sac.fai...@gmail.com]
Sent: Monday, January 11, 2010 2:51 AM
To: mysql@lists.mysql.com
Subject: mysqld occupies 100$ cpu

Hi

mysqld process taking high cpu utilization (100%), how to reduce the cup
utilization

it is running under solaris 8 with 16GB ram and 1 multicore cpu (2 core)

anyone help please?

Cheers
Faizal S
GSM : 9840118673
Blog: http://oradbapro.blogspot.com




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



Re: tmp tables

2010-01-11 Thread Keith Murphy
Victor,

Don't want to butt in, and not trying to be rude, but he gave you advice.
You don't seem inclined to take it. How else can he, or anyone else, help
you? Clearly you don't understand some fundamental issue about relational
databases. If you can't just accept his suggestion to put all carts in one
table as the way to do it then there really isn't anything else to say.

My 2 cents :)

keith

-- 
Chief Training Officer
Paragon Consulting Services
850-637-3877

On Mon, Jan 11, 2010 at 10:30 AM, Victor Subervi victorsube...@gmail.comwrote:

 On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz ba...@xaprb.com wrote:

  Victor,
 
   That strikes me as messy. Each tmp table has as many rows as necessary
  for
   the products that are to be bough. To do as you say I would have to
  create a
   table with a zillion rows to accommodate however many products I
  *predict*
   buyers would buy. Therefore, I guess I should probably create a new
  database
   so as to not make a mess of the main database.
 
  You fundamentally misunderstand relational database design.  I suggest
  reading this book:
 
 
 http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/
 

 LOL. Ok, I'll put it on my list. *In the meantime*, since I am reworking my
 database design for the shopping cart I just finished building and need to
 get this up __n_o_w__, what would your advice be?
 V

 
  Regards,
  Baron
 
  --
  Baron Schwartz
  Percona Inc: Services and Support for MySQL
  http://www.percona.com/
 



 --
 The Logos has come to bear
 http://logos.13gems.com/



Re: tmp tables

2010-01-11 Thread Victor Subervi
On Mon, Jan 11, 2010 at 11:38 AM, Keith Murphy bmur...@paragon-cs.comwrote:

 Victor,

 Don't want to butt in, and not trying to be rude, but he gave you advice.
 You don't seem inclined to take it. How else can he, or anyone else, help
 you? Clearly you don't understand some fundamental issue about relational
 databases. If you can't just accept his suggestion to put all carts in one
 table as the way to do it then there really isn't anything else to say.


I said I would read the book. I will read it. Not today, however. Today, I
will deal with this problem, because tomorrow I will be talking with the
client. First things first.
V


Re: tmp tables

2010-01-11 Thread Johnny Withers
Victor,

The temporary table solution is not a good one. Use a single table and store
each item put into a cart identified by the session ID of the user. A
process should clean out this table periodically since there are shoppers
that abandon carts from time to time.

The design of this table could be quite simple:

id - int auto_inc
session_id - varchar
added_dt - datetime
item_id - int
quantity - int

You could get more complicated depending in your need an item requirements
(colors, sizes, etc).

-JW


On Mon, Jan 11, 2010 at 9:30 AM, Victor Subervi victorsube...@gmail.comwrote:

 On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz ba...@xaprb.com wrote:

  Victor,
 
   That strikes me as messy. Each tmp table has as many rows as necessary
  for
   the products that are to be bough. To do as you say I would have to
  create a
   table with a zillion rows to accommodate however many products I
  *predict*
   buyers would buy. Therefore, I guess I should probably create a new
  database
   so as to not make a mess of the main database.
 
  You fundamentally misunderstand relational database design.  I suggest
  reading this book:
 
 
 http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/
 

 LOL. Ok, I'll put it on my list. *In the meantime*, since I am reworking my
 database design for the shopping cart I just finished building and need to
 get this up __n_o_w__, what would your advice be?
 V

 
  Regards,
  Baron
 
  --
  Baron Schwartz
  Percona Inc: Services and Support for MySQL
  http://www.percona.com/
 



 --
 The Logos has come to bear
 http://logos.13gems.com/




-- 
-
Johnny Withers
601.209.4985
joh...@pixelated.net


Re: tmp tables

2010-01-11 Thread mos

At 09:56 AM 1/11/2010, Johnny Withers wrote:

Victor,

The temporary table solution is not a good one. Use a single table and store
each item put into a cart identified by the session ID of the user. A
process should clean out this table periodically since there are shoppers
that abandon carts from time to time.

The design of this table could be quite simple:

id - int auto_inc
session_id - varchar
added_dt - datetime
item_id - int
quantity - int

You could get more complicated depending in your need an item requirements
(colors, sizes, etc).

-JW


I also agree with JW, a single table is better. Don't forget shoppers may 
spend 30 minutes of more filling up their shopping cart and may lose the 
connection to the site or have to exit without completing the order. You 
need to retain the registered user's shopping cart so he can go back to it 
later. Only delete it if there is no activity on it for 7-10 days.  If you 
use temporary tables and throw out the shopping cart contents if the 
session is lost, then you will *iss off a lot of customers.


Mike



On Mon, Jan 11, 2010 at 9:30 AM, Victor Subervi 
victorsube...@gmail.comwrote:


 On Mon, Jan 11, 2010 at 10:49 AM, Baron Schwartz ba...@xaprb.com wrote:

  Victor,
 
   That strikes me as messy. Each tmp table has as many rows as necessary
  for
   the products that are to be bough. To do as you say I would have to
  create a
   table with a zillion rows to accommodate however many products I
  *predict*
   buyers would buy. Therefore, I guess I should probably create a new
  database
   so as to not make a mess of the main database.
 
  You fundamentally misunderstand relational database design.  I suggest
  reading this book:
 
 
 
http://www.xaprb.com/blog/2009/08/22/a-review-of-beginning-database-design-by-clare-churcher/

 

 LOL. Ok, I'll put it on my list. *In the meantime*, since I am reworking my
 database design for the shopping cart I just finished building and need to
 get this up __n_o_w__, what would your advice be?
 V

 
  Regards,
  Baron
 
  --
  Baron Schwartz
  Percona Inc: Services and Support for MySQL
  http://www.percona.com/
 



 --
 The Logos has come to bear
 http://logos.13gems.com/




--
-
Johnny Withers
601.209.4985
joh...@pixelated.net



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



Help with export and import into Oracle

2010-01-11 Thread machiel.richards
Good day guys

 

I previously requested information regarding the exporting
of data which needs to be imported into oracle.

 

We are however still struggling with the data though and
maybe someone can give me some ideas...

 

It seems that one of the tables we need to export and import
contains rows which is used for dropdown menus.

 

This has the following effect:

 

. Each item in the text field is added in the field by entering
the country name then pressing enter and then entering the next, etc

. When exporting the data to a file (even when enclosing each field
within quotes) it still writes the control characters causing each item to
be read as a different line and thus the import into Oracle fails.

 

 

Any idea on how we can resolve this as the process needs to be cronned to
run on a weekly basis and thus we need to get this process resolved.

 

 

Your assistance is appreciated.

 

Regards

Machiel