n,
but I have no experience with them outside of PostgreSQL so I'll let someone
else touch on that.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http:
"Steve Osborne" <[EMAIL PROTECTED]> wrote:
> I am receiving the following error when I try to restore a database backup
> from an .sql file:
> ERROR 1064 at line 12: You have an error in your SQL syntax near
> 'PACK_KEYS=1' at line 11
> ) TYPE=ISAM PACK_KEYS=1;
>
> Cmd used to create sql:
> mysq
believe the joined fields will need to be of the same type.
Are they?
SELECT val, status
FROM A
LEFT JOIN B ON val=id
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, ple
"Dieter Hansen" <[EMAIL PROTECTED]> wrote:
> "Steve Werby" <[EMAIL PROTECTED]> schrieb am 28.11.01:
> > "Steve Osborne" <[EMAIL PROTECTED]> wrote:
> > > Simple question for one of you I am sure. I'm new to mysql (and php)
a
1. It returns true if a value is found in the supplied array, false
otherwise.
2. See the PHP manual entry for in_array() for details and examples.
http://us.php.net/manual/en/function.in-array.php
--
Steve Werby
President, Befriend
y cool.
> only responses from email address @mysql.com will be read).
Too bad you won't see this...
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
ing fields with the same name then you need to
preface the field with the tablename so MySQL knows which you are referring
to.
SELECT tablea.id FROM tablea, tableb;
SELECT tablea.id as a_id, tableb.id as b_id FROM tablea, tableb;
HTH,
--
Steve Werby
President, Befriend Internet Service
table3
WHERE month(dDate)=8
AND table1.key = table2.key
AND table1.key = table3.key
GROUP BY ...
The key will likely be your dDate field. And of course you want to make
sure you dDate is indexed, especially for such large tables.
--
Steve Werby
President, Befriend Internet Services
t of id values from the users table in your
application. If using PHP an easy way to do is loop through each result,
adding to an array then implode the array on "," and save as a $var. Then
run the delete with "...WHERE id IN ( $var )".
--
Steve Werby
Pr
"QUAN,SUU (Non-A-PaloAlto,ex2)" <[EMAIL PROTECTED]> wrote:
> is there another to shut down mysql, other than ps, then kill?
mysqladmin shutdown
--
Steve Werby
President, Befriend Internet Services LLC
http
; question, what is the best form in which to EXTRACT the data for
> running into a desktop graphing program? Write to a file in a public
> directory?
Sorry, your questions are too vague for me to answer.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.
ql database to whatever
directory you chose.
> Also it's been recommended to install with the Source instead of the
Binary. We
> want to enable BDB tables handlers also.
I don't know how the RPM version is configured, but you can't go wrong with
the source distr
d a function called mysql() that is the
reason for your error. If on the other hand you didn't paste that error and
accidentally typed mysql() instead of whatever really appeared in the error
message, perhaps something like mysql_connect() then the problem is you
don't have PHP compiled
> Both of the above queries don't work.
MySQL doesn't yet support subselects. I believe they're planned for v4.1.
> Does somebody have any idea about that? I want to avoid programming the
> minus operator in an host language ;-)
I think you may have to handle th
via a
single insert, but not into multiple tables.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
eness of the MySQL software and
benefit MySQL AB indirectly regardless of the outcome. Just my 2 cents.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check
incorrect system user. Try logging in as "mysql" (or doing "su - mysql" to
become mysql) and then try starting mysql.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before
code to the list, perhaps someone will help. And before
you do, before to echo your SQL statement to the browser so you can see
whether it is in fact correct - test by pasting it into the MySQL
commandline to ensure it works.
--
Steve Werby
President, Befriend Internet Services LL
her function that returns the difference in
time b/w two MySQL timestamps. You should be able to easily modify the
first function to suit your needs. You can find both at
http://www.befriend.com/code_gallery/php/get_elapsed_time/.
--
Steve Werby
President, Befriend Internet Services LL
the DATETIME field type instead and set the field when the record is
created using a MySQL date function or a date function within your
programming language of choice.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
x27; (Errcode: 13)
> mysql>
I have seen this error when the database (which exists as a directory on the
filesystem) or tables (files within this directory) are not owned by the
same user that MySQL runs under. It's also possible you would get the same
error if that user doesn't
st in many threads - you just need to start searching.
http://marc.theaimsgroup.com/?l=mysql
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.
0500 so it gave the currect value. If you want to
subtract one day from a date do this:
SELECT DATE_SUB( current_date, INTERVAL 1 DAY );
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
priate for your dataset. Make it UNSIGNED if you don't
expect negative numbers in the ID field.
SQL is your friend (added to please the filter).
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
"Marc Raeymaekers" <[EMAIL PROTECTED]> wrote:
> I'm a newbie with MySQL, so don't apologize me when I post a stupid
question.
>
> Is it only possible to join tables 2 by 2 or is it possible to join 4
tables in
> only one request?
Yes, you can join 4 tables
eric type that is appropriate. See the online
manual for options. If you're worried you might ruin your data with this
conversion first create a copy of the table and experiment on it instead.
CREATE TABLE my_copy SELECT * FROM original_table
Note that it won't copy the indexes, bu
columns if the same problem
occurs in "subcategory") and assign records with a category of "other" a
value of 1 and assign all other records a default value of 0. Let's call
the new field "order_1" Then you could construct an
es:
MySQL does not have referential integrity. Though it's probably not the
answer you want, referential integrity can be accomplished programatically
using the programming language you're interfacing MySQL with.
--
Steve Werby
Postgre gets faster and
MySQL adds more functionality perhaps the debate over the better RDBMS will
be more interesting.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please ch
;s impossible to say whether it supports your
clients' databases without knowing what they are.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://
the count(*) column. How would i do that??
> ...order by count(*) is not an option because it results
> in an error saying that count(*) does not exist.
Try aliasing count(*).
..., count(*) AS count
ORDER BY count
--
Steve Werby
President, Befriend Internet Servic
icks (like `ls -1
$prefix*`) to read the files within the directory containing the database.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http:
s are covered in the
online manual. If you're new to databases I suggest learning basic SQL and
spending some time reading the MySQL manual.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
--
nd MySQL lists many times.
Check the archives at http://marc.theaimsgroup.com/ for all the opinions
you'll probably ever need. And between the manuals and tutorials all over
the web, you might not need any books unless you want to learn how to build
web apps while reading on the beach.
--
Ste
handle, and the process from array? What about performance wise? I am
using
> perl w/ DBI, but I assume it would be the same if I were using the C api
as
> well.
Processing the records as they are being returned by the query is faster and
more efficient than writing the records to an array and th
E value >= LOWEND and value <=
> HIGHEND
Jim didn't want to return records with sequential IDs so that will not work.
A few of us suggested using the IN operator, which is the optimal solution.
SELECT * FROM table_name WHERE field_name IN (1,3,4);
--
Steve Werby
President, Befriend Int
can interact with MySQL
databases. As far as making it user friendly for folks from sales, that
might be futile.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, plea
ows (with
> ID's 1-20)
>
> myarray = (1,3,4)
>
> I want to return all the fields where ID = 1 and 3 and 4
SELECT * FROM table_name WHERE field_name IN (1,2,3);
See the online manual for more details.
--
Steve Werby
President,
Why not send the output of the following to the list:
DESCRIBE table_name_here;
SHOW INDEX FROM table_name_here;
First 5 records from the text file.
Command being used to import from the text file.
--
Steve Werby
President, Befriend In
MySQL benchmark may have achieved 1k queries/sec, the type of query
involved in a google search is many magnitudes more complex and
CPU-intensive. All queries are not created equal. ;-)
--
Steve Werby
President, Befriend Internet Services LL
ands of
cheap networked PCs for their search engine. They also employ a number of
techniques to reduce the disk seek and query time required. See
http://www7.scu.edu.au/programme/fullpapers/1921/com1921.htm for an in-depth
article about Google from its creators which I believe was written in 1997.
identically structured tables with different
AUTO_INCREMENT values set at table creation time and then later insert the
records into a third table and retain the incremented values.
--
Steve Werby
President, Befriend Internet Servic
d not found
> error.
Did you enter the full path to mysql? Did you go to the directory
containing the mysql binary and type "./mysql" (without the quotes)? If not
and the directory containing the mysql binary isn't in your PATH then the
server won't be able to find the comm
t state whether you're using a web scripting language, but if
you're using PHP I have a PHP function which I wrote that you could easily
edit to do what you're attempting.
http://www.befriend.com/code_gallery/php/get_elapsed_time/
--
Steve Werby
President, Befriend
n. The rest is straightforward.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
ist (the 2nd URL below):
> -
> Before posting, please check:
>http://www.mysql.com/manual.php (the manual)
>http://lists.mysql.com/ (the list archive)
Or you can use a 3rd party archive like:
http://marc.theaimsgroup.com/?l=mysql
--
Steve
the message and bypass the filtering system (which
conceptually a spammer wouldn't do).
I'd be glad to help you find a solution. Look at it this way, if you try
something and it doesn't work you can always go back to what you have in
place now. BTW, I think your company has
complish and explain what the problem is. I'm sure I (and any
number of others can help), but I don't understand the problem based on what
you've written.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
--
It's not possible to do in one step in MySQL.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
"roger westin" <[EMAIL PROTECTED]> wrote:
So a question
I have two tables. And i want to... (i just show you)
Table 1.
OwnerC
arch the list archives and manual for more info. This has been covered a
lot.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.ph
don't think this is
possible in one step using MySQL since the way I know to do it would require
a subselect, which is something MySQL doesn't yet support. A solution is to
save the output of the above SQL statement into a table (or a temporary
table using CREATE TEMPORARY TABLE) and
ster to do the calculation within
MySQL.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql
t's something to consider since this
is a problem with no perfect solution.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/man
s, find only the historical records for a
> licenceNo where March is the only record.
I didn't sleep last night and it's catching up with me so I can't think SQL
right now, but if it can't be done with a LEF
together by
http://www.spambouncer.org/ will cut down on the spam. Just my 2 cents.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql
run once for every record returned from
the outer query there might be a better way. If possible, try to use the
LEFT JOIN syntax to get the data you want from a single query. LEFT JOIN
syntax is covered in the online manual and the list archives.
--
Steve
It must be
installed by the server's root user.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://l
appens
Post to the list the output of:
DESCRIBE table1
SELECT * FROM table1 WHERE RecNo = 12
SHOW INDEX FROM table1
and the same for table2.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Befor
","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y");
>
> I tried several sintaxes but none worked.
It would be helpful if you posted what you tried. Perhaps try:
DELETE FROM user
WHERE u
ould I write the clause to ignore the time portion?
See the manual - there are a few dozen built-in date functions. For
starters try:
DATE_FORMAT( my_date, "%Y%m%d" )
TO_DAYS( my_date ) // only for dates after year 1600 or so, won't give in
desired format, but might be faster.
e port to the host as follows hostname.tld:portnum so
it's not a huge inconvenience. As a bonus, it adds a layer of security by
obscurity because malicious users will need to know the port # MySQL is
using.
--
Steve Werby
President, Befriend Internet Se
ould be) then it might make
sense to calculate the commission instead of saving it in a field. Then
again, if the number of rows is large and reports are going to be generated
based on things like total commissions by sales person by month, it might
create more overhead than des
from a parent table (projects) and the
matching records from joined tables (history, comments). You can then get
everything you need in a single query.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
, each to run as the
system user who will be using each install.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual
SELECT *
FROM accounts
LEFT JOIN addresses
ON addresses.ID = accounts.ID
> Can anyone suggest me how do I SELECT ALL of the accounts having simply
NULL
> on 'addresses.*' when there's no such row, instead of 'loosing' the whole
> 'account' row?
on the bug (which dates back about 2
years if I remember right). You should be able to find it and all of the
other posts on the subject from today in the archives at
http://marc.theaimsgroup.com/?l=mysql&r=1&w=2.
--
Steve Werby
President, B
tp://marc.theaimsgroup.com/?l=mysql&r=1&w=2 for search phrases like "big
table" "2GB", etc. for past discussions on the topic. Also, I believe this
is covered in the manual.
--
Steve Werby
Presiden
"Rekha Das" <[EMAIL PROTECTED]> wrote:
> What time function should I use to add 2 hours to a time value I am
getting
> from the database ?
Convert the time to seconds, add 7200 seconds (2 hours), then convert back
to time format.
SELECT SEC_TO_TIME(TIME_TO_SEC(my_time_fi
th type DATETIME and update it when a record is updated or
inserted. Then use SELECT MAX(datetime_field_name) and trigger your action
based on your criteria. If you are running MySQL with logging you may be
able to get update time info. from there as well.
--
Steve Werby
President,
will get you better responses since they can all be important to solving the
problem.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
"Graham Nichols" <[EMAIL PROTECTED]> wrote:
safe_mysqld --log &
I get the error message
[[EMAIL PROTECTED]
gt; would be.
If you're updating existing records use an UPDATE query.
UPDATE my_table
SET money_made = sales * 0.15;
Otherwise, if you're using a programming language like PHP or Perl to access
the DB, do something like this.
INSERT INTO my_table
VALUES (
$sales, $sales * $commission_
gt; but I got nothing in shuncheong.sql file.
You need to supply the MySQL username and password to the left of the
standard output (">") operator. Try:
mysqldump --flush-logs --add-drop-table
shuncheong -u root -pmarkloky
> /backup/shuncheong.sql
--
St
d
to run as. If mysql is installed to run as root, then 'su root', if as user
mysql, 'su mysql'. It could be a different problem all together, but that's
my first guess.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
-
SH 10
> 3 Deftones 45
>
>
> What's the SQL to select the top 2 most viewed bands
SELECT artist
FROM my_table
ORDER BY views DESC
LIMIT 2
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
--
asons, in
which case you'd be doing a 'chown -R mysql mysql' in that step. If you're
not able to login as the user root, I suggest contacting the system
administrator of the server to see if there's a MySQL install available to
you or if MySQL can be installed for you to
"Joseph Bannon" <[EMAIL PROTECTED]> wrote:
> How do I set the location of the var directory when I
> install?
./configure --localstatedir=PATH_TO_DATA_DIR See ./configure --help for more
info.
--
Steve Werby
President, Befriend Internet Services LLC
h
usr and /var partitions on the Cobalts are
pretty small and if you do logging or have large databases the partitions
will fill up fast. You might be better off installing onto /home.
--
Steve Werby
President, Befriend Interne
77 matches
Mail list logo