re: deleing exactly the same rows from a table?
Hi, I am curious if there is a way to delete exactly the same rows from a table with one query? Or must I do select and delete one query at a time? I accidentally parse an html file twice, and I want to keep the rows that are distinct. bonjour, use: deletewhere some-matching-pattern limit 1; jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: I blew it big time... locked myself out of mysql
simrad_4# safe_mysqld --skip-grant-tables [1] 57953 simrad_4# Starting mysqld daemon with databases from /var/db/mysql simrad_4# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 3.23.38 Type 'help;' or '\h' for help. Type '\c' to clear the buffer mysql grant all privileges on *.* to root@localhost identified by 'xx'; ERROR 1047: Unknown command bonjour, I get this error once. My root was'nt really root so couldn't use GRANT command. That is the same for a bash command you're not allowed to use as normal user. You need add a root password: [shell]mysql -u root mysql mysql update user set Password=password('x') wher User='root'; jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Newbie -- Error codes
Hi, I'm new to mysql. I've installed an RPM undr Linux PPC and after running mysql server as root and trying to use a sample database from Paul Dubois book MySql, I ' ve got the error 13, can't create directory/file ./samp_db/president.xxx. The thing is I'm using an example DB, any help ? Where I can find out what the codes mean ? Regards, Rick bonjour, did you ran mysql_install_db script ? jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Pattern matching queries
(REGEXP). I have a text field that contains some plain text intermingled with html tags. In querying the database, if the keyword I'm searching for falls within the plain text, that record should be returned. However, if the keyword falls within an html tag, it should not be returned. Could somebody assit me in putting such a regular expression query together? Any assistance would be greatly appreciated... thanx! database, query bonjour, SELECT fields from my_table WHERE my_field not regexp '^.*\.+\.*$'; ^ for searching at beginning of string \ for searching .* searches anything or nothing .+ searches one carachter at least \ searches $ means end of string or simply: ...not regexp '\.+\'; it depends of the importance of the html tags's position in your query. if you mean html tag = html_tag and if i do understand what you mean with my poor english... jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Inserting rows in MySQL using PHP
When i try to insert records into a mysql table through a php script, it is not inserting all the records. eg, i tried to insert 100 records, it is inserting only 94 records... plese help me in sorting out this problem bonjour, trying to insert duplicate rows in a unique field can do this kind of non-inserting problem. query, database jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: GRANT ANNOYANCE REVISITED
Thank you all for your original suggestions, but I'm still having problems. I copied this verbatim from the MySQL docs and tried it on two seperate servers: mysql GRANT ALL PRIVILEGES ON *.* TO monty@% -IDENTIFIED BY 'some_pass' WITH GRANT OPTION; ERROR 1047: Unknown command Bonjour, Are root privileges really established? I had that error message once a day. If root password is not set, in extenso there is no root, you cannot use GRANT statement. Have a look in mysql.user table to see check for root password. jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: install problem
Installing mysql on solaris 6 sun4u sparc SUNW,Ultra-5_10 release: -- mysql-3.23.38.tar.gz via ./configure --prefix=/dir --with-low-memory Is that really what you type: --prefix=/dir ? strange name for a DIRectory? Can be a reserved word. make make install I get to: yacc -d sql_yacc.yy mv y.tab.c sql_yacc.cc sql_yacc.yy, line 71: fatal: invalid escape, or illegal reserved word: pure_parser make[2]: *** [sql_yacc.cc] Error 1 make[2]: Leaving directory `/home/smith/solaris.6/mysql/sql' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/home/smith/solaris.6/mysql/sql' make: *** [install-recursive] Error 1 Any ideas? thanks - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MySQL Problem -- Please help
When I run test.php I get this: Warning: Supplied argument is not a valid MySQL result resource in common.php on line 27 0 Here are lines 25-27: 25: $sql = select urate, arate, inhits from sitestats where id = $id; 26: $r = mysql_query($sql); 27: $row = mysql_fetch_array($r); I thought using the result identifier returned by mysql_query in mysql_fetch_array was perfectly legal. bonjour, Try: ...where id = '$id'; on line 25 jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Compiling an PHP 4.0 module with MySQL
The Linux kernel is 2.2.13 and has been installed from a Mandrake distribution. This is also the source of Apache, PHP 3 and MySQL. The distribution puts files in non-standard places so I am wondering if the solution to my problem is to find the right base directory to use in the --with-mysql=/path/ syntax, and/or the header files are in the wrong place. I have searched and tried many option but with no success. Bonjour, I have a Mandrake 7.1 (2.2.15 kernel)distribution too and get problems compiling php with gd and pdf because it seems that the linker searches header files in very particular directories. So I had to mkdir /usr/local/lib/gd (and same thing with pdf) putting in .so and .h files and compilation works fine. Could it be something similar in your case? Can't you try with-mysql=/usr/local/mysql? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: problem with Grant
Have you tried 'flush privileges' after having set root password? jean-michel On Thu, 31 May 2001, Damnish wrote: I am using MySql on linux. I can start mysqld by safe_mysqld --user=mysql --skip-grant-tables But when i try to start it withour --skip-grant-tables, it said Access Denied @localhost. I have updated the mysql.user table and mysql.host table, still i can't connect it . Any help in this matter will be appriciated. Thanks in advance. Damnish - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: SQL Problem
On Mon, 28 May 2001, Lefebvre, Cedric wrote: I have a problem adapting a multiple select to MySQL. Can someone help me ? Here is my request (Oracle format) SELECT Tactic.teamCode FROM Tactic WHERE Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE Game.gameTurn = Turn.code) AND Tactic.teamCode NOT IN (SELECT Game.teamCode2 FROM Game, Turn WHERE Game.gameTurn = Turn.code); I could use the following one, if it's easier to translate to MySQL SELECT Tactic.teamCode FROM Tactic WHERE Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE Game.gameTurn = 3) AND Tactic.teamCode NOT IN (SELECT Game.teamCode2 FROM Game, Turn WHERE Game.gameTurn = 3); bonjour, You can't use subselect. -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MySQL and PHP4
On Fri, 25 May 2001, Andrey Kotrekhov wrote: I don't agree. If mysql install in other directory then /usr/local you need use --with-mysql=mysqldir and sometimes --with-mysql-include and --with-mysql-lib options. Do you need to specify a directory? I just did --with-mysql At 01:14 PM 5/24/2001 -0400, Bill Tangren wrote: When I compile PHP4 (4.04pl1) with the option --with-mysql=mysqldir... I get the error 'cannot find mysqlclient library under mysqldir' I did a search through the mysqsl (3.23.38) source code after I compiled it, and I don't find that library anywhere? What am I doing wrong? bonjour, I compiled mysql with --prefix=/usr/local/mysql and then php: CPPFLAGS=-I/usr/local/mysql/include/mysql ./configure --with-mysql=/usr/local/mysql -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: mysql/php problem.
On Fri, 25 May 2001, Stephanie Deville wrote: I'm running FreeBSD 3.4, Apache 1.3.9 w/ php4 and mysql 3.22.32. The problem I'm having is that my php scripts work fine, mysql works fine. When I run a php script, everthing in the script works up to the point were I try mysql_connect. I get no error, but the script just hangs. It never connects to the database. I've looked through all my logs, and there are no errors listed anywhere. Any ideas? Stephanie DeVille bonjour, Can you give us an idea of your script? -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: installing mysql(password??)
On Sun, 27 May 2001, David Loszewski wrote: when you first install mysql server does it assign a default password becuase it tells me to enter these in to make a password for my server, but I don't know what the heck to do with them, but when I try them it says access denied /usr/bin/mysqladmin -u root -p password 'new-password' /usr/bin/mysqladmin -u root -h Precious -p password 'new-password' Dave Bonjour, You can set a root-password starting the server with safe_mysqld --skip-grant-tables then connect to mysql:mysql -u root then: mysql update user set password=password(the-password-I-want) where user = 'root'; You use the password() function to set a new password. -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Password security
On Sun, 29 Apr 2001, Philippe Louis Houze wrote: Date: Sun, 29 Apr 2001 10:56:52 -0400 From: Philippe Louis Houze [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Password security Hi, How do you keep MySQL password out of view of visitors when needed in PHP to access the db. The password is in plain english in all the php files, and can be easily downloaded by anyone. Philippe ex: ? mysql_connect(host, user, password); mysql_select_db(database); ? ? include(variables.php3); $link = mysql_connect($db_server,$db_login,$db_password); mysql_select_db($db,$link); ? and in variables.php3 file ? $db_server = host; $db_login = user; $db_password = mypassword; $db = database; ? and protect include-directory with .htaccess -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: File Not Found Error
On Wed, 25 Apr 2001, newsgroups wrote: Date: Wed, 25 Apr 2001 20:15:07 -0400 From: newsgroups [EMAIL PROTECTED] To: MySQL-Group [EMAIL PROTECTED] Subject: File Not Found Error Sorry to be such an everything newbie. Perhaps this a unix error and not MySQL but a simple Describe statement reports that a *.frm file is missing, yet that file exists in the same folder. What could be wrong? Sorry about the long LS. TIA, John ... # mysql -p mysql Didn't find any fields in table 'adminedit' Didn't find any fields in table 'levelone' Didn't find any fields in table 'members' mysql show tables; +-+ | Tables_in_mysql | +-+ | adminedit | | columns_priv| | db | | func| | host| | levelone| | members | | tables_priv | | user| +-+ 9 rows in set (0.00 sec) Bonjour, It sometimes happens to me with mysql 3.22.32 (rpm) on mandrake 7.1. Somes files become uid/gid root/root instead of mysql/mysql. So I need to change file permissions. May be someone get an answer? I apologize for my poor english... -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: ERROR 1046: No Database Selected
On Fri, 20 Apr 2001, Siomara Pantarotto wrote: Date: Fri, 20 Apr 2001 19:35:52 -0300 From: Siomara Pantarotto [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: ERROR 1046: No Database Selected Hi all, I am getting this error mysql create table Product ( - productID numeric(10), - name varchar(30), - primary key(productID) - ); ERROR 1046: No Database Selected mysql How do I fix that please??? siomara mysqluse the-database-y-created-before; -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: client problems
On Tue, 10 Apr 2001, Erik Kabo wrote: Date: Tue, 10 Apr 2001 18:37:17 -0400 From: Erik Kabo [EMAIL PROTECTED] Reply-To: Erik Kabo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: client problems Hi, I installed MySQL version 3.23 in RedHat 7.0 using gnorpm. After I installed it, the server appears to be working fine, but there is no client software. I try running "mysql" at the command prompt, but I get a command not found error. I tried the GUI on your download page, but it just stalls at the splash screen when I try to run it. Can you tell me where to get a client that works? Thanks, Erik [EMAIL PROTECTED] I needed to install MySQL rpm AND MySQL-client rpm in Mandrake 7.1 jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Foreign Keys
On Thu, 5 Apr 2001, Dennis Gearon wrote: Date: Thu, 05 Apr 2001 14:24:25 -0700 From: Dennis Gearon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Foreign Keys Are people using Mysql using foreign keys and how are they using them? It seems that the way to use them is with the scripting language used to access the database. bonjour, neither foreign keys nor need for foreign keys using mysql. Use WHERE clause. -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Duplicate of Everything in Table
On Fri, 6 Apr 2001, Vigile wrote: Date: Fri, 6 Apr 2001 01:26:05 -0400 From: Vigile [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Duplicate of Everything in Table I have a table, that DOES NOT have a primary key, but is setup like this: Field Type Attributes Null Default Extra Action PageID int(11)No 0Change Drop Primary Index Unique ArticleID int(11)No 0Change Drop Primary Index Unique PageTitle textNo Change Drop Primary Index Unique Text textNo Change Drop Primary Index Unique However, for some reason (I think I know why, but its not important) I have two of every entry. Such as this: 169words words 269words words more 369words words most 169words words 269words words more 369words words most So, when I am calling info from this database, I get doubles of each result. How can I delete just one of each entry, so I am left with just: 169words words 269words words more 369words words most I can't do the delete that I was thinking about: Delete FROM Pages Where Pageid=1 and articleid=69 because that would delete BOTH of them. Doh! Any help? Ryan Shrout Production Manager Athlonmb.com http://www.athlonmb.com [EMAIL PROTECTED] bonjour, is: delete from Pages where PageId='1' enough? jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: rpm with php
On Fri, 6 Apr 2001, Kenneth wrote: Date: Fri, 6 Apr 2001 10:22:29 +0800 From: Kenneth [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: rpm with php Hello All, I'm trying to install MySQL RPM with php. Should I use: --with-mysql or --with-mysql=/usr/bin or --with-mysql=/path/to/mysql ? Thanks for any suggestion/comment in advance! bonjour, --with-mysql=path/to/mysql is a configure option when compiling php from sources. Use only rpm -ivh mysql-rpm -- jean-michel - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: NEW MAKE BUG? sigcontext.h
On Mon, 2 Apr 2001, Derek Sivers wrote: Date: Mon, 02 Apr 2001 19:42:18 -0700 From: Derek Sivers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: NEW "MAKE" BUG? sigcontext.h Doing a "make" on the newest MySQL stable 3.23.36 source tarball - on a stock Cobalt RaQ3 (Linux 386) which I've installed MySQL on many times before. Got this strange error: gcc -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -I./../include -I./.. -I..-O6 -DDBUG_OFF -c readline.c In file included from /usr/include/signal.h:300, from readline.c:50: /usr/include/bits/sigcontext.h:28: asm/sigcontext.h: No such file or directory Anyone know what it means? How would you debug this? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Bonjour, 1st possibility /usr/include/linux/ and /usr/include/asm/ must be linked to /usr/src/linux/include/linux/ and /usr/src/linux/include/asm/ 2nd possibility if sigcontext.h really exists, this file is not in /usr/include/bits/ where make is searching for it. ah + jm oltra - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php