RE: .dump files

2001-06-17 Thread Chris Bolt
That is a .sql file renamed to a .dump file, there's no difference. Import it with phpMyAdmin or mysql -u username -ppassword dbname < whatever.dump > i had some others that i browsed into phpmyadmin and they seemed to > work, but others, like this one, showed a Query error -but that > "method" o

RE: .dump files

2001-06-16 Thread Chris Bolt
What format are they in? Please paste a few sample lines. > hello, > > i have some files from a Cd that are .dump files, how do i get these > db into mysql? (is it possible using phpMyAdmin). > > again, these are ".dump" files, not ".sql" files. --

RE: I think this is a bug for sure...

2001-06-15 Thread Chris Bolt
> Assuming any SQL statement that causes the mysqld to go away is a bug: > > Assume table foo has a column bar bigint(20); > > select * from foo where bar = 0x7fff; > > The above works fine. The below crashes the server: > > select * from foo where bar = 9223372036854775807; > > They

RE: order by rand() question

2001-06-15 Thread Chris Bolt
> Gotcha. So is there any way to return 5 (some number) rows, chosen > randomly, and then sort them by date (or name or whatever). So the final > result is a list, sorted by date, but of rows chosen randomly from the > table. CREATE TEMPORARY TABLE temptable TYPE=HEAP SELECT * FROM theTable ORD

RE: Possible Bug in mysql 3.23.38

2001-06-15 Thread Chris Bolt
> After creating a new database, I ran: > > update user set password = 'SomeJunk' where user = 'root'; > > This inserts the string 'SomeJunk' literally into the database, > unencrypted. This is SQL expected but the result is a database > lockout (not to mention the security breach of having the c

RE: order by rand() question

2001-06-15 Thread Chris Bolt
> In a slight change of this question (since I have no data to > currently test this with, as my ISP is using too old a > version of mysql), does anyone know what something like > this would do? > > SELECT * FROM theTable ORDER BY RAND(), date LIMIT 5; Exactly the same as SELECT * FROM theTable O

RE: PHP and mysql and images

2001-06-15 Thread Chris Bolt
Why would you want to do that? That's what filesystems are for. > Can any one tell me how place images in to a mysql database and then > retrieve them later? - Before posting, please check: http://www.mysql.com/manual.php

RE: recursive query

2001-06-15 Thread Chris Bolt
http://marc.theaimsgroup.com/?l=mysql&m=99213870412899&w=2 http://marc.theaimsgroup.com/?l=mysql&m=99214323317893&w=2 http://www.bolt.cx/misc/thread.txt > hi, > > how can i make recursive querys in mysql? > i want to show a tree. > > my table: > tree (id int, parent int, name char(10)); ... > t

RE: indexing = NP complete??

2001-06-15 Thread Chris Bolt
> Is this machine basically dedicated to MySQL? If so, I'd try bumping > up the record_buffer to 16 or 32MB and see what that does. I've got it > set at 32MB on a server with 1GB of RAM. I'm looking at my-huge.cnf included with mysql 3.23.39 and it has a record_buffer of 1M. Are the example confi

RE: cvs access

2001-06-15 Thread Chris Bolt
> Hi folks! > > I would like to know if it's possible that some have read access > to MySQL cvs repository? If yes, how may i have read acces (like > an anonymous account). Check out the CVS link on http://sourceforge.net/projects/mysql/ --

RE: MySQL compression?

2001-06-15 Thread Chris Bolt
Look up myisampack in the mysql manual at http://www.mysql.com/doc/. The only drawback is you can't modify the table. > I have a table that has massive amounts of text. Just plain text, stuff > that would compress REALLY well. Does mysql have any sort of compression > internally for the table d

RE: Collapsing queries

2001-06-15 Thread Chris Bolt
SELECT cont.msg_id, cont.msg_text, CONCAT_WS(', ', a1.address, a2.address) FROM CONTENT AS cont, ADDRESS AS a1, ADDRESS AS a2 WHERE cont.msg_id = a1.msg_id AND cont.msg_id = a2.msg_id; Many thanks to salle in efnet #mysql for teaching me this trick ;-) > Hello, > > I am relatively new with MySQL

RE: order by rand() question

2001-06-15 Thread Chris Bolt
> I don't think the answer has changed since last week :-) > > IMHO it's not "really slow and inefficient", anyway - this script: (clipped) > produces a table with 1 rows each containing an integer. Then we do: > > mysql> SELECT * FROM mytable ORDER BY RAND() LIMIT 5; (clipped) > 5 rows in set

RE: Help: Replication between 2 tables

2001-06-14 Thread Chris Bolt
http://www.mysql.com/doc/N/a/Name_case_sensitivity.html Rename the METADATA table on the slaves to metadata and start mysqld with -O lower_case_table_names=1. > Hello, > > I am trying to set up mysql replication between 4 machines each > with version 3.23.38 installed. My problem is that the mas

RE: query

2001-06-12 Thread Chris Bolt
> Hi: > > Just wondering what 'MUL' means in the key column when you look at > tables...I understand PRI is primary key... The index contains values which occur MULtiple times (as opposed to a UNIque index where every value occurs once) database,sql,query --

RE: Auto Increment

2001-06-11 Thread Chris Bolt
> I have a customer file, keyed by an auto-increment customer > number. Customers can have orders. The order file is keyed by an > auto-increment order sequence number, which works fine, but is not > convenient. Rather, I would like the order sequence number to start at 1 > for each customer, a

RE: Q: max value?

2001-06-11 Thread Chris Bolt
SELECT max(fieldname) FROM table; > Hi! > > Does anybody knows how can I check whether the max value in some > database's > field has > been reached? > For example, I have MEDIUMINT column and I want to reset its value once it > reaches its maximum, that is 8388607. How can I check which is the m

RE: Once again, this doesn't do anything.

2001-06-11 Thread Chris Bolt
The insert statement is valid (see http://www.mysql.com/doc/I/N/INSERT.html, third example), just uncommon. > I can't help with the php...but I do know that insert statement > is invalid. ... >> $sql = "insert into sitesats set areview='$areview', >> apositive='$apositive', anegative='$anegative'

RE: Case insensitive records search

2001-06-11 Thread Chris Bolt
mysql> SELECT 'a' LIKE 'A'; +--+ | 'a' LIKE 'A' | +--+ |1 | +--+ 1 row in set (0.00 sec) mysql> SELECT 'a' LIKE 'b'; +--+ | 'a' LIKE 'b' | +--+ |0 | +--+ 1 row in set (0.00 sec) It's already case inse

RE: Once again, this doesn't do anything.

2001-06-10 Thread Chris Bolt
Try echo(mysql_error()); after each call to mysql_query() > The following code doesn't insert and update info in the db for > some reason: (clipped) > Thanks in advance. - Before posting, please check: http://www.mysql.com/m

RE: Is there a list archive for this mailing list?

2001-06-10 Thread Chris Bolt
http://marc.theaimsgroup.com/?l=mysql&r=1&w=2 > Is there a list archive for this list? I have a few questions which I am > sure are asked all the time. But For the life of me I can't seem > to find the > answer's in the documentation at mysql.com. Thx, ---

RE: MySQL Problem -- Please help

2001-06-09 Thread Chris Bolt
> I thought using the result identifier returned by mysql_query in > mysql_fetch_array was perfectly legal. mysql_query() doesn't always return a valid result identifier if an error occurs (echo mysql_error()) or if no rows are returned. -

RE: SQL question

2001-06-09 Thread Chris Bolt
I don't think it's possible purely with SQL using MySQL. I tried researching it just a few days ago, and found Oracle supports a clause CONNECT BY ... PRIOR (more info at http://www.arsdigita.com/books/sql/trees.html) which does this for you, but it's still in the MySQL todo list (http://www.mysql

RE: The table is full: bug in 3.22.32?

2001-06-09 Thread Chris Bolt
http://www.mysql.com/doc/F/u/Full_table.html > Hello, > > I tried to make a query to MySQL, the version is: mysql Ver 9.38 Distrib > 3.22.32, for pc-linux-gnu (i686). The result should be about 4843 rows, > but I got this message instead of the result: > ERROR 1114: The table 'SQL22e0b00_0' is

RE: -bin.001 --- files?

2001-06-09 Thread Chris Bolt
They are mysql binary logs of updates to your databases, and are usually only needed for replication across multiple servers. If you don't need this, remove or comment out the log-bin line from /etc/my.cnf and restart mysqld, then you can delete them. > Hi Folks, > > I am running a webserver with

RE: Speed of query - And Indexes

2001-06-09 Thread Chris Bolt
> I've used a rule of thumb that I was told ages ago when working on other > databases that inserting records into a non-indexed table is faster > generally than inserting records into an identical but indexed table. Makes sense to me, since it has to update the indexes in the latter case. Howeve

RE: Speed of query

2001-06-08 Thread Chris Bolt
> Hello all, > > does anyone have any feedback whether there is any difference in the > efficiency of the following query on a fairly large dataset > > 1. select * from tbl This will be the slowest. > 2 select count(*) from tbl This will be very fast since MySQL is optimized for it (the number

RE: query in different DB

2001-06-08 Thread Chris Bolt
Try it =P (just don't forget the WHERE clause) If you want to make your query easier to write, use aliases: SELECT d1t1.field1, d2t1.field1, d2t2.field2 FROM database1.table1 AS d1t1, database2.table1 AS d2t1, database2.table2 AS d2t2 WHERE d1t1.id = d2t1.id AND d2t1.id = d2t2.id > Can I do que

RE: Ideas?: ERROR 1030: Got error 127 from table handler

2001-06-08 Thread Chris Bolt
> Is there a common cause to the following problem?: > > mysql> select parent_referral from referral; > ERROR 1030: Got error 127 from table handler chris@mirage:~$ perror 127 Error code 127: Unknown error: 127 127 = Record-file is crashed chris@mirage:~$ > Our system is running 3.22.23b and we

RE: JOIN to the same table multiple times

2001-06-08 Thread Chris Bolt
You really shouldn't be using SELECT *. Try SELECT S1.sitename AS FirstSiteName, S2.sitename AS SecondSiteName, etc etc etc. > Ok, I've answered my own question but now have another. > > How do I reference the sitename for the 3 sites? > sitename returns the last sitename for all 3 I tried S1.sit

RE: Table Creation woes

2001-06-06 Thread Chris Bolt
describe is a reserved word, use another name for the column. http://www.mysql.com/doc/R/e/Reserved_words.html > can someone tell me what I'm doing wrong here?I keep getting the error > "You have an error in your SQL syntax near 'describe text, fulltext text, > section VARCHAR (32) DEFAULT '

RE: help how to undo concat

2001-06-05 Thread Chris Bolt
UPDATE tablename SET columnname = substring(columnname, 1, if (locate('string', columnname) > 0, locate('string', columnname) - 1, length(columnname))); > Hi, > > I have a database column of char(250); I can insert enmass a string > into said column using: > > update tablename set columnname = co

RE: MySQL Beta 4

2001-06-05 Thread Chris Bolt
>From CVS; http://sourceforge.net/cvs/?group_id=47 modulename would be mysql-4.0 > Does anyone know where to get hold of a 4.0 Beta for MySQL. Any > info is appreciated. - Before posting, please check: http://www.mysql.com

RE: Let's try this again..HELP PLEASE

2001-06-02 Thread Chris Bolt
> 2 - Your INSERT statement is using a SELECT statement to > chose VALUES to be inserted into the table. Since MySQL > does not support sub-SELECT statements, the second part > of your query is not returning any values, resulting in > the NULL value error stated above. MySQL does support INSERT .

RE: Where to get a list of explanations for Errcodes?

2001-06-02 Thread Chris Bolt
chris@illusion:~$ perror 13 Error code 13: Permission denied chris@illusion:~$ Make sure your database directory is owned by the same user that MySQL is running as. > When I attempt to get into this database this error > comes up, but other databases work ok. I cannot find a > reference to 'Er

RE: update query produces warnings?

2001-05-30 Thread Chris Bolt
Change the id column to something larger than a TINYINT (like MEDIUMINT or INT). You should also make ID the primary key. > Hello everyone, > > I have a database of alumni at school. Each alumnus that > registers gets assigned their own id. Id's are made with mysql's > auto_increment. Everythi

RE: "Match" does not find it, but "Like" finds it

2001-05-28 Thread Chris Bolt
>From http://www.mysql.com/doc/F/u/Fulltext_Search.html: mysql> SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('MySQL'); Empty set (0.00 sec) Search for the word MySQL produces no results in the above example. Word MySQL is present in more than half of rows, and as such, is effectively

RE: Copying to temp table

2001-05-28 Thread Chris Bolt
Use fulltext indexes (http://www.mysql.com/doc/F/u/Fulltext_Search.html). Queries with LIKE '%...%' will always be slow because they can't use indexes, and you're doing SIX of them, of course it'll take a while. Only drawback of fulltext indexes is (AFAIK) you can't match against fields in separat

RE: Determining Database size via SQL

2001-05-28 Thread Chris Bolt
If you are using only fixed-length (no VARCHARs, TEXTs or BLOBs) MyISAM tables you can calculate it by finding the storage required for each row (http://www.mysql.com/doc/S/t/Storage_requirements.html) and multiplying it by the number of rows. If you are using variable-length MyISAM tables, you sh

RE: copying to tmp table

2001-05-28 Thread Chris Bolt
Paste EXPLAIN SELECT ... (your SELECT); from the mysql client. > Hi! > > When I join 4 tables with about 3000 records in each mysql seems to work > forever on "copying to tmp table". > > I wonder what that could be. I have enough free space in the tmp-dir and > don't know what else could it be.

RE: Compute SQL Function Not Supported

2001-05-21 Thread Chris Bolt
In your original message, you said "You will get a summary of prices by type in your results." and that is what my query gives you. It returns the sum of the price columns from any rows that are eliminated by the GROUP BY clause. What do you want it to return? > Please strike previous message the

RE: Compute SQL Function Not Supported

2001-05-21 Thread Chris Bolt
SELECT type, sum(price) FROM products GROUP BY type ORDER BY type > I take it the Computer SQL Function is not support by MySQL and if not is > there a substitute for it? > > If you are unfamiliar with the command it works like this: > > SELECT type, price > FROM products > ORDER BY type > COMP

RE: Symbolic Links under Windows

2001-05-20 Thread Chris Bolt
You can also download Junction from http://www.sysinternals.com/ntw2k/source/misc.shtml#junction which does the same thing. sql > Hello Tom, > > If you're using Windows 2000 it has junction points. It's almost the > same as symbolic links in UNIX. Except it works only for directories. > > Try

RE: Fulltext and 2 to 3 character words...

2001-05-19 Thread Chris Bolt
http://www.mysql.com/doc/F/u/Fulltext_Search.html Search for the word MySQL produces no results in the above example. Word MySQL is present in more than half of rows, and as such, is effectively treated as a stopword (that is, with semantical value zero). It is, really, the desired behavior - a n

RE: Table sizes?

2001-05-18 Thread Chris Bolt
Make your auto_increment primary key something bigger than a TINYINT > ive run into some trouble with a table not taking more then 128 > rows. I just use MySQL from my webpage, with PHP, and its all > done by my host, so im a novice here. Anything i can do to get > the table to accept more the

RE: MySQL instalation problem

2001-05-18 Thread Chris Bolt
> You can start the MySQL daemon with: > cd /usr/local/mysql ; /usr/local/mysql/bin/safe_mysqld & ... > [root@stupidsiteforjerks mysql-3.23.38]# /usr/local/mysql/bin/mysqladmin > -u > root -p password 'new-password' > Enter password: > /usr/local/mysql/bin/mysqladmin: connect to server at 'localho

RE: SELECT DISTINCT on two columns

2001-05-18 Thread Chris Bolt
Only way I can think of is to use a temp table: CREATE TEMPORARY TABLE test (fruits varchar(100) not null) TYPE=HEAP; INSERT INTO test SELECT DISTINCT fruits1 FROM table; INSERT INTO test SELECT DISTINCT fruits2 FROM table; SELECT DISTINCT fruits FROM test; DROP TABLE test; However this can be s

RE: Grant problems

2001-05-18 Thread Chris Bolt
I think you're using it incorrectly. It should be: grant insert on test.* to testuser@localhost identified by 'testpassword'; > I have successfully installed MySQL 3.23.38. I can start the server > and log in as root. When I try to grant new users using: > > grant insert to test.* for testu

RE: ENUM and large strings

2001-05-18 Thread Chris Bolt
Perhaps in your case it would be better to use another table and do a join? > Hi! > > In order to save space in our database, we designed our tables to use > enumerated datatypes. For one column, we have about 2,800 > different values, > each of which is about 30-40 text characters long. Now,

RE: question about a select application (sql, database)

2001-05-18 Thread Chris Bolt
Does the table have an auto_increment column? If so: select * from table where autoinccolumn = LAST_INSERT_ID(); > I wrote a program to keep inserting rows to the databases. But I > want to check the LAST row I inserted. Is there any good way to do it?? --

RE: Efficient Query/Database Structure?

2001-05-17 Thread Chris Bolt
Create another table with an id column and a code column, and for each code insert a column with the id of the row in the original database and the code. Then do an SQL join to search. For example: mysql> create table example (id int(11) NOT NULL auto_increment, blah varchar(100), PRIMARY KEY(id)

RE: specifying date format for retrieving dates and datetimes

2001-05-17 Thread Chris Bolt
> Is there a simple way to force mySQL to always return dates and > datetime in > ISO > long format, without the '-', ':' and spaces? (in a TIMESTAMP(14) like > format) > > I always want 20010517 rather than 2001-05-17, > and 20010517130500 rather than 2001-05-17 13:05:00 Use ints and bigints?

RE: Run Mysql command from a file.

2001-05-15 Thread Chris Bolt
With windows, you can use "type filename.sql | mysql ..." > Maybe he's running in some windows version?? > It seems to me that your example using std-in is the easiest. I would > suggest also writing a perl program but in this case I thing your > example is > right on. Then again if he's using

RE: Urgent Help Needed

2001-05-14 Thread Chris Bolt
> The one we tried was: > > $SQL = " SELECT * FROM cvtemplate WHERE employment_type = > '$employment_type' > AND location = '$location' AND related_discipline = > '$related_discipline', > MATCH specific_work_profile, wxcdone, wxcdtwo, wxcdthree, > wxcdfour AGAINST > ('$keywords') AS score FROM cvt

RE: Hockey Scoring/Penalty counting query in mySQL

2001-05-12 Thread Chris Bolt
> SQL STATEMENT: > > SELECT > players.playerid,name, > count(goals.goalid) AS goals, > count(penalties.penaltyid) AS penalties > FROM players > LEFT JOIN goals ON (players.playerid=goals.playerid) > LEFT JOIN penalties ON (players.playerid=penalties.playerid) > GROUP BY players.playerid

RE: Ordering of Dates

2001-05-11 Thread Chris Bolt
Add ORDER BY postdate DESC to the end of the query. > I'm creating a Blogger-like system for my website and I have it check for > posts within the last 14 days using the following command: > > $result = mysql_query("SELECT * FROM data WHERE TO_DAYS(NOW()) - > TO_DAYS(postdate) <= 14",$db); > > Ho

RE: group by (bug)

2001-05-11 Thread Chris Bolt
This is not a bug. Why don't you just select * from abc where field2 = 'I am the first';? Or: mysql> select *, min(field2) from abc group by field1; +--++-++ | ID | field1 | field2 | min(field2)| +--++-+---

RE: mysqladmin

2001-05-07 Thread Chris Bolt
http://www.mysql.com/doc/C/o/Connecting.html Scroll to the bottom, where it describes adding your password to .my.cnf in your home directory. > I actually wanted to disable passwords completely. > > so when I type mysql the mysql> comes up. > > Tom -

RE: QS works if applied through phpMyAdmin but not from a PHP-Script

2001-05-06 Thread Chris Bolt
Have you looked at mysql_error() ? Are you sure $select_ is a valid php variable name? > Oi, > > I cannot get my head around that. > I got a QS that worked fine, then I edited the PHP-script, not the part > which is now causing errors, and it does not work anymore. That > is strange, > if there w

RE: select query?

2001-05-04 Thread Chris Bolt
select ip, mac from ipmac group by mac having count(*) > 1; > I have a table with IP/MAC address combinations and I want to track > which MAC address might have used an IP address other than the one > originally assigned. > > Is there some way that I can query my table for duplicate MAC > addres

RE: distinct on varchar fields

2001-05-04 Thread Chris Bolt
Have you tried: select concat("blah", x, "bleh") from y group by x; > Hi All, > > when I use a distinct on varchar fields, does mySQL truncate the value > of the string to some set value. > This two queries give me a completely different number of rows and I am > not sure how to influence the

RE: Doubt

2001-05-03 Thread Chris Bolt
> >I've recently moved from MS-SQL Server 7.0 to mySQL. In MSSQL I > >used to give the default value 'GetDate()' for a field in the > >database with the datetime datatype. In mySQL I tried using Now(). > >But when I insert a new row the datetime field is taking :00:00 > >00:00:00 value

RE: Auto_increment or manual??

2001-05-03 Thread Chris Bolt
Yes, I know from experience, it's the best way to do it. And if you need to get the number generated by an auto_increment column in an insert, you can use last_insert_id() (or mysql_insert_id() with php). > Thank you Chris with this info! This will greatly help me out, so as I see > it now, ther

RE: Auto_increment or manual??

2001-05-03 Thread Chris Bolt
http://www.mysql.com/doc/R/e/Replication_Features.html Replication will be done correctly with AUTO_INCREMENT, LAST_INSERT_ID, and TIMESTAMP values. > This sounds encouraging, but are there any known problems with the MySQL > replication model currently available?? Would the slave servers have t

<    1   2