niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
err-report help me
Post new topic   Reply to topic Page 66 of 67 [996 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2, 3, ..., 64, 65, 66, 67 Next
Author Message
Brent Baisley
*nix forums Guru Wannabe


Joined: 10 Feb 2005
Posts: 122

PostPosted: Thu Jul 06, 2006 1:17 pm    Post subject: Re: special char in full-text search Reply with quote

MySQL doesn't index the special characters, some of which are considered word separators, like the period. MySQL indexes words, not
strings (sort of).
I had a similar problem on one of my projects where I needed to index resumes for searching. Typical searches would include C++, C#,
..NET, etc. None of which mysql would index.
What I did was created a word conversion list and added a search words field to the database. The search words field would contain
the problematic search words into strings that MySQL would index (CPlusPlus, CSharp, dotNET, etc). The full text index would then be
a compound index of the original text plus the search words field.
The front end would handle searching the text for conversion words before inserting/updating the database. It would then convert the
problematic words that were present and populate the search words field with them. The front would also do a similar conversion when
a user entered a search for one of those words.
It's not perfect, but I always used boolean full text searching and MySQL does support proximity searches, so it worked well enough.
Although I never did figure out how to search on C, J, or any other single character programming language.

Hope that gives you some ideas.

----- Original Message -----
From: "Harini Raghavan" <harini.raghavan@insideview.com>
To: <mysql@lists.mysql.com>
Sent: Thursday, July 06, 2006 2:06 AM
Subject: special char in full-text search


Quote:
Hi All,

I am using the MySQL full text search capability in the search workflow in my appplication. I found that MySQL treats special
character like *./,* etc. as tokenizers if they are not specified within a phrase(inside double quotes). For ex. If the search
string entered is M.B.A or 24/7 then it searches for M, B, and A sepearately. I can't include the quotes for all search strings as
wild char(*) search would not work when specified within a phrase. Is there a way to avoid MySQL from tokenizing the search
criteria?
Any ideas?

Thanks,
Harini

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



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
James Harvard
*nix forums addict


Joined: 12 Dec 2005
Posts: 56

PostPosted: Thu Jul 06, 2006 1:50 pm    Post subject: Re: MySQL 5.0.22 and show columns bug? Reply with quote

Although I know nothing about C I imagine this is because the 'type' column can contain all the possible values from an ENUM or SET field.
James Harvard

At 10:30 am +0000 6/7/06, SciBit MySQL Team wrote:
Quote:
Since a couple of recent stable versions back (and more recently, MySQL 5.0.22), MySQL has been returning the column length (C API) of the 'Type' column of a "show columns from.." statement as being 196605 (almost 192KB), when this column only really contains data in the region of 10 bytes

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
SciBit MySQL Team
*nix forums beginner


Joined: 20 Dec 2005
Posts: 3

PostPosted: Fri Jul 07, 2006 8:32 am    Post subject: Re: MySQL 5.0.22 and show columns bug? Reply with quote

While you are not wrong, James, is the length member suppose to denote the maximum length of data contained in result's specified column. NOTE: The result's. I.e. why give such an arbitrary number of bytes/length when no ENUM's or SET's are even in the result. The point being, even if you create a table containing 10 INT columns, the result of "show columns from" should show the Type column length of 3 with a maximum data allocation for the 10 rows of 30 bytes, and not ~2MB, as is currently the case.

And even, in a worse case, MySQL Dev decided to give the length back as the maximum "potential" length, who determined 196605 should be the "magic number"? An ENUM can have 64K values, each of which can be a text value/label of at least 64 characters, thus a "magic number" should be at least megs in size to "play it safe". Thus, such an approach is simply put, stupid.

Ideally, as was the case in previous versions of MySQL, the Type column's Length should be given in context of the result, i.e. if there is an ENUM in the column list and it has the longest "type" description, the Type column's length should reflect its contained data size.

Kind Regards
SciBit MySQL Team
http://www.scibit.com

Quote:

-----Original Message-----
From: "James Harvard" <james.lists.tech@harvard-digital.co.uk
To: "SciBit MySQL Team" <mysql@scibit.com
CC: "mysql@lists.mysql.com" <mysql@lists.mysql.com
Subject: [Spam-Junk]Re: MySQL 5.0.22 and show columns bug?
Sent: Thu, 06 Jul 2006 13:50:33 GMT
Received: Thu, 06 Jul 2006 13:50:29 GMT
Read: Sat, 30 Dec 1899 00:00:00 GMT
Although I know nothing about C I imagine this is because the 'type' column can contain all the possible values from an ENUM or SET field.
James Harvard

At 10:30 am +0000 6/7/06, SciBit MySQL Team wrote:
Since a couple of recent stable versions back (and more recently, MySQL 5.0.22), MySQL has been returning the column length (C API) of the 'Type' column of a "show columns from.." statement as being 196605 (almost 192KB), when this column only really contains data in the region of 10 bytes

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






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
James Harvard
*nix forums addict


Joined: 12 Dec 2005
Posts: 56

PostPosted: Fri Jul 07, 2006 9:19 am    Post subject: Re: MySQL 5.0.22 and show columns bug? Reply with quote

OK, fair enough. In that case I would think that filing a report on bugs.mysql.com would be your best way forward.

At 8:32 am +0000 7/7/06, SciBit MySQL Team wrote:
Quote:
While you are not wrong, James, is the length member suppose to denote the maximum length of data contained in result's specified column. NOTE: The result's. I.e. why give such an arbitrary number of bytes/length when no ENUM's or SET's are even in the result. The point being, even if you create a table containing 10 INT columns, the result of "show columns from" should show the Type column length of 3 with a maximum data allocation for the 10 rows of 30 bytes, and not ~2MB, as is currently the case.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Russell Horn
*nix forums beginner


Joined: 25 May 2005
Posts: 10

PostPosted: Fri Jul 07, 2006 3:08 pm    Post subject: Innodb import tuning on Sun T2000 Reply with quote

Folks,

I'm trying to import a sql dump of a database which is taking an age.
I've disabled foreign key constraints, unique checks and set autocommit
to 0 but this is still slow.

My data file has a number of tables, one of which has circa 3.5 million
tuples taking up about 500MB of data with 900MB of indexes. This seems
to be where we are slowing down. Most the other tables are much smaller.

The server is a Sun T2000 with 6 cores and 8GB of RAM. We're using the
local disks.

I'm using the mysql.conf file from
http://media.zilbo.com/img/feh/mysql/my.cnf though I've increased
innodb_buffer_pool_size to 3G

Is there anything else I can do to speed up these operations, or should
I resign myself to the import taking several hours each time it's
required?

TIA,

Russell


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Jacob, Raymond A Jr
*nix forums beginner


Joined: 21 Mar 2005
Posts: 27

PostPosted: Mon Jul 10, 2006 2:36 am    Post subject: How does one speed up delete-Again Reply with quote

I started the operation below on Friday at 1300hrs EST
DELETE data
FROM data, event
WHERE data.cid = event.cid
AND event.timestamp < "2006-05-01"


It is now Sunday 22:00hrs EST and the operation is still running.

Question: Should it take this long to delete 7.5 million records from a
4.5GB
Table?

Question: Other than writing a script to export all the cid's to a file
and deleting the records one at a time so at least I can delete some
records.
Is there a way to delete records one at a time or in groups
so that if I have to stop the operation the delete will not rolled back?

Question:Does anyone on the list have experience deleting what I guess
is a large number of
records from a large table? i.e. how long does it take?

r/Raymond


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Brent Baisley
*nix forums Guru Wannabe


Joined: 10 Feb 2005
Posts: 122

PostPosted: Mon Jul 10, 2006 12:50 pm    Post subject: Re: How does one speed up delete-Again Reply with quote

I've had to delete large amounts of records from tables with over 200 millions records. You are correct in that you want to do it in
chunks. How you divide the deletes is up to you to decide. You would want to do it based on a indexed column, like a date, and
specify a range.
DELETE data
FROM data, event
WHERE data.cid=event.cid
AND event.timestamp between "2006-01-01" and "2006-01-07"

DELETE data
FROM data, event
WHERE data.cid=event.cid
AND event.timestamp between "2006-01-08" and "2006-01-15"
....

You'l find it will go much, much quicker if you can narrow down the number of records deleted at one time. A delete that I would
give up on after a few hours take a few minutes by doing it in chunks.

BUT, if your data is always going to be divided into date chunks where you'll periodically delete everything prior to a certain
date, you may want to look into merge tables. Typically a merge table is a psuedo table that is comprised of a set of underlying
tables. You can add/drop underlying tables very quickly, or you could even reference an underlying table directly for certain tasks.
Under the right circumstances, merge tables can provide considerable amount of scalability.

----- Original Message -----
From: "Jacob, Raymond A Jr" <raymond.jacob@navy.mil>
To: <mysql@lists.mysql.com>
Sent: Sunday, July 09, 2006 10:36 PM
Subject: How does one speed up delete-Again


I started the operation below on Friday at 1300hrs EST
DELETE data
FROM data, event
WHERE data.cid = event.cid
AND event.timestamp < "2006-05-01"


It is now Sunday 22:00hrs EST and the operation is still running.

Question: Should it take this long to delete 7.5 million records from a
4.5GB
Table?

Question: Other than writing a script to export all the cid's to a file
and deleting the records one at a time so at least I can delete some
records.
Is there a way to delete records one at a time or in groups
so that if I have to stop the operation the delete will not rolled back?

Question:Does anyone on the list have experience deleting what I guess
is a large number of
records from a large table? i.e. how long does it take?

r/Raymond


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


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Jacob, Raymond A Jr
*nix forums beginner


Joined: 21 Mar 2005
Posts: 27

PostPosted: Mon Jul 10, 2006 4:43 pm    Post subject: Re: How does one speed up delete-Again Reply with quote

Could the problem the Locked data table in this case?
mysql> show processlist;
+-----+-------+-----------------------------------+-------+---------+---
-----+--------------+---------------------------------------------------
---------------------------------------------------+
| Id | User | Host | db | Command |
Time | State | Info
|
+-----+-------+-----------------------------------+-------+---------+---
-----+--------------+---------------------------------------------------
---------------------------------------------------+
| 1 | goat | xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 | snort | Query |
424668 | Locked | INSERT INTO data (sid,cid,data_payload) VALUES
('2','13305243','00000000450000C10FEF40002F11D162CD9E |
| 524 | root | localhost | snort | Query |
424669 | Sending data | DELETE data from data JOIN sidtemp ON data.cid sidtemp.cid |
| 537 | root | localhost | snort | Query |
242922 | Locked | DELETE data
FROM data, event
WHERE data.cid = event.cid
AND event.timestamp < "2006-05-01" |
| 542 | root | localhost | NULL | Query |
0 | NULL | show processlist
|
+-----+-------+-----------------------------------+-------+---------+---
-----+--------------+-----------------------------

I killed 524 & 537, started over and CPU went down. The query is still
slow.
Do I need to bring the database down to single user mode(I don't know
the correct
Term so I just am guessing single user mode exists) then do the delete?

Thank you,
Raymond
Back to top
Jacob, Raymond A Jr
*nix forums beginner


Joined: 21 Mar 2005
Posts: 27

PostPosted: Mon Jul 10, 2006 7:53 pm    Post subject: Re: How does one speed up delete-Again Reply with quote

It appears that every time I start query the event or the data table
gets Locked.
Could this have any affect on why it takes so long to delete records.

Grasping at straws,
Thank you,
Raymond




mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
1555 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305568',
'12', '2006-07-10 11:48:22. |
| 542 | root | localhost |snort | Query
| 1555 | Sending data | DELET
E


data
FROM data, event
WHERE data.cid = event.cid
AND event.timestamp < "2006-04-01"
|
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 1555 | | NULL

|
| 544 | root | localhost |snort | Query
| 0 | NULL | show
processlist
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--processlist
|
| 545 | root | localhost |snort | Query
| 308 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.00 sec)

mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
333 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 333 | | NULL

|
| 544 | root | localhost |snort | Query
| 0 | NULL | show
processlist
|
| 545 | root | localhost |snort | Query
| 333 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.00 sec)

mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
337 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 337 | | NULL

|
| 544 | root | localhost |snort | Query
| 0 | NULL | show
processlist
|
| 545 | root | localhost |snort | Query
| 337 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.01 sec)

.....

mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+---------------------------------------------------------
----------------------------------------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
1627 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 1627 | | NULL

|
| 545 | root | localhost |snort | Query
| 1627 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
| 546 | root | localhost | NULL |
Query | 0 | NULL | show
processlist
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.00 sec)
.....
mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
3955 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 3955 | | NULL

|
| 545 | root | localhost |snort | Query
| 3955 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
| 546 | root | localhost | NULL |
Query | 0 | NULL | show
processlist
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.00 sec)

mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
3958 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 3958 | | NULL

|
| 545 | root | localhost |snort | Query
| 3958 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
| 546 | root | localhost | NULL |
Query | 0 | NULL | show
processlist
|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
4 rows in set (0.00 sec)

mysql> show processlist;
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| Id | User | Host | db |
Command | Time | State | Info

|
+-----+-------+-----------------------------------+---------------+-----
----+------+--------------+------
------------------------------------------------------------------------
------------------------+
| 1 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62693 |snort | Query |
3960 | Locked | INSER
T INTO event (sid,cid,signature,timestamp) VALUES ('2', '13305782',
'12', '2006-07-10 12:16:30. |
| 543 |goat| xxxxxxxxxxxxxxxxxxxxxxxxxxx:62680 | snort_archive | Sleep
| 3960 | | NULL

|
| 545 | root | localhost | snort |
Query | 3960 | Sending data | DELET
E data FROM data, event
WHERE data.cid = event.cid AND event.timestamp < '2006-03-03'
|
| 546 | root | localhost | NULL |
Query | 0 | NULL | show
processlist
|
+-----+-------+-----------------------------------+---------------+-----
----+------+-

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Willy Mularto
*nix forums beginner


Joined: 31 Mar 2005
Posts: 5

PostPosted: Wed Jul 12, 2006 2:50 am    Post subject: Re: datetime issue on MySQL 4.x (SOLVED) Reply with quote

Hello,
I have solved this problem, thanks.

Regards


Willy
----- Original Message -----
From: Willy
To: mysql@lists.mysql.com
Sent: Wednesday, July 12, 2006 8:55 AM
Subject: datetime issue on MySQL 4.x


Hello,
I have a MyISAM table:

CREATE TABLE `dlr` (
`msisdn` varchar(20) NOT NULL default '',
`source` varchar(20) NOT NULL default '',
`operator_id` varchar(20) NOT NULL default '',
`sms_message` longtext NOT NULL,
`smsc_id` varchar(20) NOT NULL default '',
`sms_id` varchar(250) NOT NULL default '',
`dlr_smsc` text NOT NULL,
`dlr` tinyint(4) NOT NULL default '0',
`date_time` datetime NOT NULL default '0000-00-00 00:00:00'
) TYPE=MyISAM

I have a case here, on July 7 I imported some data into the table with this query:

INSERT INTO dlr (source, msisdn, operator_id, sms_message, smsc_id, sms_id, dlr_smsc, dlr, date_time)
VALUES
('366508', '1234', 4, '', 'IM33665', MD5(RAND()), 'RE:', '2', NOW()),
('366508', '1234', 4, 'id:0943381383 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:xxxx, 'IM33665', MD5(RAND()), 'RE:id:0943381383 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:xxxx', '2', '2006-06-28 03:17:00'),
('366508', '1234', 4, 'id:1226442088 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:xxxx', 'IM33665', MD5(RAND()), 'RE:id:1226442088 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:Silahkan tawar: XDA ', '2', '2006-06-28 03:17:00'),
('366508', '1234', 4, 'id:1861980498 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:xxxx', 'IM33665', MD5(RAND()), 'RE:id:1861980498 sub:001 dlvrd:000 submit date:0606280317 done date:0606290317 stat:EXPIRED err:999 text:xxxx', '2', '2006-06-28 03:17:00'),
('366508', '1234', 4, '', 'IM33665', MD5(RAND()), 'RE:', '2', NOW()).......

And when I try to fetch the data using PHP with this query:

SELECT operator_id, DATE_FORMAT(date_time,'%d-%m-%Y') AS tanggal, COUNT(*) AS TOTAL FROM dlr WHERE 1=1 AND dlr = 8 AND MONTH(date_time) = MONTH(NOW()) GROUP BY tanggal, operator_id ORDER BY date_time

The weird thing happened. Why does all the rows are shown or treated as July 7th data? If we see the imported data, there should be June 28, June 29.....until July 7. Please help and many thanks for any reply.

Regards


Willy
Back to top
sheeri kritzer
*nix forums Guru Wannabe


Joined: 19 Oct 2005
Posts: 243

PostPosted: Thu Jul 13, 2006 6:24 pm    Post subject: Re: create view and insert into problems Reply with quote

create view v_authornames as
select authorid, CONCAT(lastname,',',firstname)
from t_authors;

Or replace the middle term in the CONCAT function to whatever you want
to separate it -- ie, ' ' for a space, or just
CONCAT(lastname,firstname) to get output "KritzerSheeri".

-Sheeri

On 6/25/06, Andreas Bauer <andreas_bauer@arcor.de> wrote:
Quote:
Hello NG,

I have two tables in my mysql database
created with phpmyadmin:

t_authors:
1 authorid (primary key, auto_increment)
2 lastname
3 firstname

And a table named t_books, fields inside:

t_books:
1 bookid (primary key, auto_increment)
2 authorid (Typ:index, reference to authorid from t_authors done
with phpmyadmin)
3 title
4 subtitle

Now I want to create a view from t_authors, so that the fields
of lastname and firstname are one field with
the value inside: "lastname, firstname":

create view v_authornames as
select authorid, lastname || ', ' || firstname
from t_authors;

But this view created only an empty field named
lastname ||', ' firstname. How can I join this two
fields so that I get one and this value?

There is another problem of me inserting values sequently in
the two tables:


insert into t_authors (lastname, firstname)
values ('Meyers', 'Scott');

insert into t_books (authorid, title, subtitle)
values ('1'), 'Effektiv C++ Programmieren',
'50 Wege zur Verbesserung Ihrer Programme und Entwuerfe');

insert into t_books (authorid, title, subtitle)
values ('1'), 'Mehr Effektiv C++ Programmieren',
'35 neue Wege zur Verbesserung Ihrer Entwuerfe und Programme');

insert into t_authors (lastname, firstname)
values ('Schlossnagle', 'George');

insert into t_books (authorid, title, subtitle)
values ('1'), 'Advanced PHP Programming', 'A practical guide');


The problem is the authorid of t_books: which value should I take for
authorid of table t_books.
If I took '1', the referenced value of the authorid from t_authors was not
taken from the authorid from t_books, but always the value '1'?
If I took '0' or others I get errors.
In phpmyamin I set the reference to t_authors.authorid in the
t_books.authorid field.

Best regards and many thanks

Andreas



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



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
<fleet@teachout.org>
*nix forums beginner


Joined: 16 Jul 2006
Posts: 3

PostPosted: Mon Jul 17, 2006 3:28 pm    Post subject: Re: load-file() doesn't work [SOLVED] Reply with quote

SHORT SYNOPSIS:
The statement
INSERT INTO table (blob_column) VALUES
(load_file('/home/somebody/image.jpg'));

Produces no error; but fails to load the image file.

SOLUTION:
The image file (or other binary file, I assume) MUST reside in / or /tmp,
ie /image.jpg or /tmp/image.jpg. (At least in MySQL 3.23.36)

I *hope* this is a bug!

- fleet -



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Marc Alff
*nix forums beginner


Joined: 12 Mar 2006
Posts: 3

PostPosted: Mon Jul 17, 2006 5:03 pm    Post subject: Re: load-file() doesn't work [SOLVED] Reply with quote

Hi Fleet


fleet@teachout.org wrote:
Quote:
SHORT SYNOPSIS:
The statement
INSERT INTO table (blob_column) VALUES
(load_file('/home/somebody/image.jpg'));

Produces no error; but fails to load the image file.

SOLUTION:
The image file (or other binary file, I assume) MUST reside in / or /tmp,
ie /image.jpg or /tmp/image.jpg. (At least in MySQL 3.23.36)

I *hope* this is a bug!

- fleet -



Just to check, is the /home partition actually mounted on the server,
and at the same place ?

In other words, does /home/fleet/image.jpg exists :
- when seen from the host running mysql
- when seen from the host running mysqld

Marc.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
<fleet@teachout.org>
*nix forums beginner


Joined: 16 Jul 2006
Posts: 3

PostPosted: Mon Jul 17, 2006 5:23 pm    Post subject: Re: load-file() doesn't work [SOLVED] Reply with quote

On Mon, 17 Jul 2006, Marc Alff wrote:

Quote:
Just to check, is the /home partition actually mounted on the server,
and at the same place ?

In other words, does /home/fleet/image.jpg exists :
- when seen from the host running mysql
- when seen from the host running mysqld

In answer to the above: to the best of my knowledge. I haven't a clue how
to check that. I'm a user, not a tech. I have another small database
that produces an html output. It places it in my $HOME directory without
any specific path instructions; so I'd have to say mysql and mysqld *do*
see the directories.

mysql is running on my home PC. This particular PC is about 5 years old.
/home/fleet is my $HOME directory. I'm launching mysql from $HOME using:
[~]$ mysql -u root
mysql was installed (by someone who presumably knew what they were doing)
when I purchased the computer. I've never used it before now.

- fleet -



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Dilipkumar
*nix forums beginner


Joined: 08 May 2006
Posts: 18

PostPosted: Tue Jul 18, 2006 7:52 am    Post subject: Re: load-file() doesn't work [SOLVED] Reply with quote

Hi,

If you have like insert statments try using this as

login into mysql
mysql -u root -p
use database-name

\. /tmp/filename.txt


Thanks & Regards
Dilipkumar
----- Original Message -----
From: "Marc Alff" <marc.alff@comcast.net>
To: <fleet@teachout.org>
Cc: <mysql@lists.mysql.com>
Sent: Monday, July 17, 2006 11:21 PM
Subject: Re: load-file() doesn't work [SOLVED]


Quote:

Hi Fleet


fleet@teachout.org wrote:
SHORT SYNOPSIS:
The statement
INSERT INTO table (blob_column) VALUES
(load_file('/home/somebody/image.jpg'));

Produces no error; but fails to load the image file.

SOLUTION:
The image file (or other binary file, I assume) MUST reside in / or /tmp,
ie /image.jpg or /tmp/image.jpg. (At least in MySQL 3.23.36)

I *hope* this is a bug!

- fleet -



Just to check, is the /home partition actually mounted on the server,
and at the same place ?

In other words, does /home/fleet/image.jpg exists :
- when seen from the host running mysql
- when seen from the host running mysqld

Marc.


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


********** DISCLAIMER **********
Information contained and transmitted by this E-MAIL is proprietary to
Sify Limited and is intended for use only by the individual or entity to
which it is addressed, and may contain information that is privileged,
confidential or exempt from disclosure under applicable law. If this is a
forwarded message, the content of this E-MAIL may not have been sent with
the authority of the Company. If you are not the intended recipient, an
agent of the intended recipient or a person responsible for delivering the
information to the named recipient, you are notified that any use,
distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at admin@sifycorp.com

Watch India vs. England LIVE, Hot videos and more only on Sify Max! Click Here. www.sifymax.com

Get to see what's happening in your favourite City on Bangalore Live! www.bangalorelive.in


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 66 of 67 [996 Posts] Goto page:  Previous  1, 2, 3, ..., 64, 65, 66, 67 Next
View previous topic :: View next topic
The time now is Tue Dec 02, 2008 5:31 am | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Success delivery report kennykilla Postfix 0 Wed Aug 29, 2007 9:06 am
No new posts Bug Report - Solaris 10 spell Richard B. Gilbert Solaris 0 Fri Jul 21, 2006 11:22 am
No new posts Work-needing packages report for Jul 21, 2006 wnpp@debian.org devel 0 Fri Jul 21, 2006 6:50 am
No new posts Work-needing packages report for Jul 14, 2006 wnpp@debian.org devel 0 Fri Jul 14, 2006 6:50 am
No new posts Work-needing packages report for Jul 7, 2006 wnpp@debian.org devel 0 Fri Jul 07, 2006 6:50 am

Debt Consolidation | Literatura fantastica | Mortgages | McDonalds | Hotel Portal France, Italy, UK
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 6.3285s ][ Queries: 16 (6.1439s) ][ GZIP on - Debug on ]