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
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.
--
> 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
> 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
> 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
> 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
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
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
> 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
> 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/
--
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
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
> 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
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
> 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
--
> 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
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
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'
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
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
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,
---
> 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.
-
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
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
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
> 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
> 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
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
> 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
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
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 '
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
>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
> 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 .
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
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
>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
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
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
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.
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
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
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
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
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
> 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
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
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
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,
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??
--
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)
> 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?
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
> 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
> 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
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
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)|
+--++-+---
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
-
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
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
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
> >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
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
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
101 - 164 of 164 matches
Mail list logo