mysql-test-run -- func_compress failed with out of memory error...
Hi! I am in the process of upgrading the machine with everything to a newer versions. This time, I'm getting rid of the IBM DB2 as it won't be there. So, I downloaded the MySQL 64 bits for the AIX and extracted it there. The AIX server use 64 bits kernel and Enhanced Journal File System (JFS2). It also have 1 GB of RAM and 35 GB Hard Disk. I remembered that running this test is require to make sure MySQL work properly and can handle the workload with the machine. So, I typed the mysql-test-run command and here's what I got. --snip- fulltext [ pass ] fulltext2 [ pass ] fulltext_cache [ pass ] fulltext_distinct [ pass ] fulltext_left_join [ pass ] fulltext_multi [ pass ] fulltext_order_by [ pass ] fulltext_update[ pass ] fulltext_var [ pass ] func_compress [ fail ] Errors are (from /usr/local/mysql/mysql-test/var/log/mysqltest-time) : mysqltest: At line 48: query 'select compress(repeat('aa', IF('', 10, 1000))) is null' failed: 5: Out of memory (Needed 12024 bytes) (the last lines may be the most important ones) Aborting: func_compress failed in default mode. To continue, re-run with '--force'. Ending Tests Shutting-down MySQL daemon Master shutdown finished Slave shutdown finished --snip- I'm a little baffled because the server have 1 GB of RAM. Something is wrong. So, what's up with that? Thanks, Scott
Does MySQL support server with 2 cpu??
Hi! We wanna know is does MySQL support the use of the server with 2 cpu? I have trouble finding that on the mysql.com website. If so, how does the configuration for the use of 2 CPU work?? Thanks, Scott D. Fletcher
RE: How to make 1 primary key work for 2 columns????
Seldom wrong and right again, Shawn! Yes, I forgot to cover the reflexive case. I don't have a magic bullet for that scenario; you'd just have to check that with application code. But on re-reading his original post, it occurred to me that I had misread it completely. I just sent a note outlining my new thinking to the list; maybe we can help this guy solve his problem without having to write a lot of application code ;-) I have now come to the conclusion. The idea I just posted from the last email is not going to work either because I would have 2 or more people accessing the same table at the same time, so no email addresses will be unique. The same would goes for creating a new table too because of a few reasons. 1) The 2nd person would be unable to update the email if the primary key is set. 2) I would have to use the application code to remove a row if the customer decided not take out the email address, like the secondary email in this case. The reason for all of this email address is I had builted a lost password retrieval webpage. In plain English, if an email address is found then send an email with the lost account number and password to that email address. So, I came up with a plan this morning. I'm going to leave the original table intact and instead I will use the application code to do this... 1) If no email address is found then don't send an email. 2) If duplicate email address is found then don't send an email and the customer would have to call us instead. 3) If an email address (one row) is found then send email to that email address. This is what I going to settle on. It's the best way to go It would also help me to avoid having to update the HTML, JavaScript, PHP and SQL code in almost 50 webpages. That's a lot of time when you think about it. Thnaks, Scott -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
How to make 1 primary key work for 2 columns????
Hi! I'm trying to figure out how to make this possible... What I have here is a company address, along with both the primary contact and secondary contact. In them is one email address from the primary contact and one other email address from the secondary contact. Problem is setting an unique primary key that treated the 2 columns as one column with unique email address. Let's this example below --snip- | First_Email | Second_Email | | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- --snip- be like this below where there is no two same email address --snip- --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- --snip- Thanks, Scott
RE: How to make 1 primary key work for 2 columns????
Aw Man! I forgot about the null value... Since there will be some null values, so I can't use the primary key. So, I now know it is not possible. Thanks for reminding me that. So, seem that the workaround for me is to retrieve all of the emails from the primary contact and secondary contact into PHP variables then encrypt it then put it into the hidden HTML input. I'll have to create the JavaScript validation to encrypt the entered email address (primary and secondary) and match it against the hidden HTML input. If matched then prompt the user to enter a different email address, if not matched then it's okay to enter it into the database. It's the only way... Thanks, Scott -Original Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 3:30 PM To: Scott Fletcher Subject: Re: How to make 1 primary key work for 2 columns - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 3:54 PM Subject: How to make 1 primary key work for 2 columns Hi! I'm trying to figure out how to make this possible... What I have here is a company address, along with both the primary contact and secondary contact. In them is one email address from the primary contact and one other email address from the secondary contact. Problem is setting an unique primary key that treated the 2 columns as one column with unique email address. Let's this example below --snip- | First_Email | Second_Email | | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- --snip- be like this below where there is no two same email address --snip- --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- --snip- This will work: create table mytab (from_email char(100) not null, to_email char(100) not null, [other columns], primary key(from_email, to_email)); There's no reason the primary key can't contain several columns as long as each is defined NOT NULL. (No column of a primary key may ever contain a null.) The primary key, then, is the COMBINATION of values in all of the columns that make up the primary key. Therefore, the following would be allowed: from_email to_email [EMAIL PROTECTED][EMAIL PROTECTED] [EMAIL PROTECTED][EMAIL PROTECTED] If you need to ensure that the 'from_email' value is also unique within the table, you can add a 'unique' constraint to the definition of the from_email value. Ditto for the 'to_email' column. Therefore, the following definition ensures that the combination of 'from_email' and 'to_email' is always unique AND it ensures that no single value appears twice in 'from_email' AND it ensures that no single value appears twice in 'to_email'. create table mytab (from_email char(100) not null unique, to_email char(100) not null unique, [other columns], primary key(from_email, to_email)); Rhino -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: How to make 1 primary key work for 2 columns????
Sorry you didn't understand what's I'm asking for. It take some logical thought to see the picture. Now I know I will have to enforce it with the application code (PHP, HTML and JavaScript) with the current two column model. Thanks for this idea Scott From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 3:28 PM To: Scott Fletcher Cc: [EMAIL PROTECTED] Subject: Re: How to make 1 primary key work for 2 columns I couldn't understand exactly what you were asking for. Did you want no duplicates between columns or no duplicates between companies or what? This is something you will either enforce in your application code (with your two column model) - OR - you will have to redesign your Primary and Secondary storage to a single column (like your example). Something like this: CREATE TABLE contacts ( company_ID int not null, email_address varchar(255) not null, email_type ENUM('primary', 'secondary') default 'primary' Primary_key (company_ID, email_address) ) The way I defined this primary key means that for any company, an email address can appear only once. However, that email can be used for multiple companies (a common sales person shared between smaller businesses, for example). Do you want it so that an email is always specific to only one company? Options abound. Please be more specific about what rule you would like to enforce and we can help you write a constraint that works for you. Shawn Green Database Administrator Unimin Corporation - Spruce Pine Scott Fletcher [EMAIL PROTECTED] wrote on 10/20/2004 03:54:12 PM: Hi! I'm trying to figure out how to make this possible... What I have here is a company address, along with both the primary contact and secondary contact. In them is one email address from the primary contact and one other email address from the secondary contact. Problem is setting an unique primary key that treated the 2 columns as one column with unique email address. Let's this example below --snip- | First_Email | Second_Email | | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- --snip- be like this below where there is no two same email address --snip- --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- --snip- Thanks, Scott
RE: How to make 1 primary key work for 2 columns????
I wonder if it is possible for MySQL to create a virtual table upon every SQL selection by grabbing emails from two columns into an imaginationary table in the server's memory. So, what is the SQL term for that? That way, I can match it against it to see if it is a match or not. I can do that with with DB2 but MySQL is different. Thanks, Scott - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 3:54 PM Subject: How to make 1 primary key work for 2 columns Hi! I'm trying to figure out how to make this possible... What I have here is a company address, along with both the primary contact and secondary contact. In them is one email address from the primary contact and one other email address from the secondary contact. Problem is setting an unique primary key that treated the 2 columns as one column with unique email address. Let's this example below --snip- | First_Email | Second_Email | | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | [EMAIL PROTECTED] | --- --snip- be like this below where there is no two same email address --snip- --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- | [EMAIL PROTECTED] | --- --snip- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
my.cnf - do we need it or not?
Hi! Do we really need the my.cnf file to tweak MySQL? Mine doesn't have it and it just work fine... Thanks, Scott
Do Analyze Table before Optimize Table or the other way around??
I wanna know is do I do the Analyze the table before the Optimize the table or should I do it the other way around??? Thanks, FletchSOD
Bash Shell issue with the mysqldump's password.....
I am struggling to get the bash script to use the password. What I'm doing here is to assign it to a variable.. --snip- MySQLdump_FilePath=/usr/local/mysql/bin/mysqldump UserId=root DB_Production=DB_NAME #Emarket_Production_Filepath=`/home/website/ProductionDB.sql` #Prefix_Production_CmdLine=$MySQLdump_FilePath -u ${UserId} --password='[EMAIL PROTECTED]' $DB_Production #$Prefix_Production_CmdLine /home/website/test.sql 21 --snip- I added the backslash-escape to the $ character 'cause of bash. The password still doesn't work in bash script. I'm not sure if it is because the password then become a string, along with the \ Beside the password value, does anyone have ever successfully use the bash script to use the password option in a string tag or in a variable tag or something? I welcome suggestions... FletchSOD
Using the Index (Tables)....
I have one question. Once I create 2 or more indexes to a table, should I instruct MySQL to use which index in certain order? (Like use that 2nd index, not the 1st one). Another question, do I need to run the maintance on the index? If so, how? With IBM DB2, I had to run the index maintance weekly, so I wonder if MySQL do it automatically or do I have to do it manually. If so, how? Thanks, FletchSOD
FW: Using the Index (Tables)....
-Original Message- From: Scott Fletcher Sent: Thursday, August 05, 2004 11:00 AM To: 'KSTrainee' Subject: RE: Using the Index (Tables) One more question. Does the column's name have to be in order by col1, col2 and col3? Or does it not matter which order, like col1, col3, col2, where the select * from table where col1, col3, col2 do the searching? --snip-- CREATE INDEX part_of_name ON customer (name(10)); --snip-- Thanks, FletchSOD -Original Message- From: KSTrainee [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 10:17 AM To: Scott Fletcher Subject: AW: Using the Index (Tables) if you have one or more indexes on a table, the query optimizer will pick the most valueable by itself. the most important thing about 'valueable' is the key's cardinality which describes the number of unique values within the key. imagine this table: col1col2 A 1 A 2 A 3 ... A 99 B 1 B 2 B 3 ... B 99 a key on col1 won't get you anywhere because it will route to only two unique values. if you query this like select * from mytable where col1 = 'A' and col2 = '3' will mysql cause to ignore(!) you key because doing a full table scan with only a few seeks and a lot burst reads is faster that a lot of seeks and a few random reads. if you set the key to cover (col1,col2), your query will return the row in no time, as the key directly leads to the one single row. in general, you don't _have_ to do maintance of the keys. however, if you update/insert/delete a lot of rows, you should run 'ANALYZE TABLE mytable;' so the table's statistics get updated. the query optimizer will pick the most valueable keys from there... -Ursprüngliche Nachricht- Von: Scott Fletcher [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 5. August 2004 17:01 An: [EMAIL PROTECTED] Betreff: Using the Index (Tables) I have one question. Once I create 2 or more indexes to a table, should I instruct MySQL to use which index in certain order? (Like use that 2nd index, not the 1st one). Another question, do I need to run the maintance on the index? If so, how? With IBM DB2, I had to run the index maintance weekly, so I wonder if MySQL do it automatically or do I have to do it manually. If so, how? Thanks, FletchSOD -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Grant privileges to a new database...
What I have here is a database-driven website. In the past, I created a database and grant privileges to it. Now, I'm creating a carbon copy of it into another website which will be a test website with a test database. So, when I try the grant privileges to the test database, it returned a zero row count. So, the question I have here is it allowed or supported in MySQL to have two database with same localhost account and non-localhost account. I hope I explained it clearly... Thanks, Scott
Verify the database backup from mysqldump???
Is it possible to verify the database backup. Like most machines, that make backup of files then verify that all of it is backed up without an error? I use mysqldump to make a backup but I have no idea about the verify Thanks, Scott
Using SQL's JOIN to return all rows regardless of non-exist rows in other tables....
I'm trying to figure out how to get the table FUNDED_INFO to return all rows, even if there is no row(s) in the two other tables, STOCK CUSTOMERS. This one doesn't really work 'cause either one of the two tables, STOCK and CUSTOMERS doesn't have a row which would cause a row from FUNDED_INFO not to be returned at all... --snip-- SELECT FUNDED_INFO.TIMESTAMP, FUNDED_INFO.ACCT_NUMBER FROM FUNDED_INFO INNER JOIN STOCK ON FUNDED_INFO.ACCT_NUMBER = STOCK.ACCT_NUMBER INNER JOIN CUSTOMERS ON FUNDED_INFO.ACCT_NUMBER = CUSTOMERS.ACCT_NUMBER --snip-- So, I believe that a LEFT JOIN would be the answer, if so what would be the appropriate syntax exactly to reflect that?? Thanks, FletchSOD -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Using function followed by order by function_name(table.field_name).....
I'm having a little bit of a trouble with the use of the SQL function... What I have here is a webpage that show the row of data, the web user get to click on the field to sort the row by the field name. So, when I use order by char(field_name), the data doesn't turned out right in alpha-numeric in ascending order... --snip-- Debug Test (WM Account) 1 ABC Company Riverknoll A C SDFONE'sdf SeaWater --snip-- I would like the first few letter of each row be in correct alpha-numeric order regardless of what character is there in the data, like (, ), ', ?, etc... Thanks, FletchSOD
MySQL Storage Engines and Table Types.....
Hi! How do I know which of the storage engine am I using or running, or whatever that use the databases/tables? Thanks, Scott F.
Questions about MySQL's INSERT syntax....
Hi! The SQL's INSERT Syntax that have been frequently been used is --snip-- INSERT INTO TABLE1 (COLUMN1,COLUMN2,COLUMN3,COLUMN4,COLUMN5) VALUES ('ONE','TWO','THREE','FOUR','FIVE') --snip-- where the TABLE1 have 5 columns, COLUMN1, COLUMN2, COLUMN3, COLUMN4, COLUMN5. What I wanna know is will MySQL accept a fewer columns instead of all, like this... --snip-- INSERT INTO TABLE1 (COLUMN1,COLUMN3) VALUES ('ONE','THREE') --snip-- Because on some database software/application, it won't accept this if the table get very long with many columns and I was forced to use all of hte columns in the SQL Syntax. I don't know how MySQL react to this with a very long table and with many columns. Thanks, Scott F.
MySQL -- SQL syntax error.....
When I use this SQL statement, ... --snip-- UPDATE BUSINESS_CATEGORY SET (BUSINESS_CATEGORY.BUS_CAT,BUSINESS_CATEGORY.BUS_DESC) = ('JUNKKK','JUNK123KK') WHERE BUSINESS_CATEGORY.BUS_CAT_ID = '733788' --snip-- I get the SQL syntax error saying, --snip-- You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(BUSINESS_CATEGORY.BUS_CAT,BUSINESS_CATEGORY.BUS_DESC) = ('JUNK --snip-- So, I looked up in MySQL's documentation at http://dev.mysql.com/doc/mysql/en/UPDATE.html, it didn't say anything helpful about the SQL syntax. So, what did I do wrong?? Thanks, Scott F. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Column's DataType -- TEXT vs BLOB...
I'mwrestling over deciding on which data type to go with, TEXT or BLOB. I have one table with one column of400 characters, I was thinking that TEXT may be the way to go for that one. I also have another table that use 4 columns of 800 characters along with 5 columns that use 250 characters. I'm thinking of using TEXT for 9 of those columns. The reason is because I read the MySQL Manual there that say TEXT and BLOB are pretty much the same in many ways, the only thing different is that BLOB use "VARCHAR" Binary while TEXT use "VARCHAR". But reading the article somewhere (not part of MySQL's Manual) say this... --snip-- If it doesn't have to be searchable then a BLOB might be more efficient and you shouldn't have to worry about size (Like size is important? ). The reason being that BLOB information is stored seperate from the table data and is related by a reference number in the table. This keeps the table smaller and faster as I understand. --snip-- So, I don't feel too sure what to decide on... Care for some advice or recommendation?? Thanks, Scott Fletcher
A Table with a timestamp as transaction date and primary key...
I read some articles that the use of SQL's TIMESTAMP in a table is use for recording the actual date/time that the row was inserted and for row(s) that is/are updated. I'm a little troubled by that because I want a table with a timestamp in the first column to be the transaction date which can be done by insert and that the timestamp not be altered with the SQL update of any sort. I also want the TIMESTAMP to be a primary key. So, what is my options? Thanks...
GRANT PRIVILEGES doesn't perform the way I expect it to....??
I'm having a little trouble with granting the correct privilege to the user with one database instead of all databases. When I do this with all databases, it work great.. --snip-- //Issued SQL Command... GRANT ALL ON *.* TO 'Username'@'localhost.domain.com' mailto:'Username'@'localhost.domain.com' IDENTIFIED BY 'Password' //Correct Data in user table in mysql database.. +---+-+--+-+-+-- ---+-+-+---+-+-- -+--+---++-+ ++--++-- -+--+--+-+-- +--++-+--+---+-- ---+-+ | Host | User| Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | +---+-+--+-+-+-- ---+-+-+---+-+-- -+--+---++-+ ++--++-- -+--+--+-+-- +--++-+--+---+-- ---+-+ | localhost | Username | 14617e5f1090a4a9 | Y | Y | Y | Y | Y | Y | Y | Y | Y| Y | N | Y | Y | Y | Y| Y | Y | Y | Y| Y | Y| | | | | 0 | 0 | 0 | +---+-+--+-+-+-- ---+-+-+---+-+-- -+--+---++-+ ++--++-- -+--+--+-+-- +--++-+--+---+-- ---+-+ --snip-- I don't want to this user to have access to most databases, just only one database. When I do this, it doesn't grant the priviledges the same way... --snip-- //Issued SQL Request GRANT ALL ON DATABASE_NAME.* TO 'Username'@'localhost.domain.com' mailto:'Username'@'localhost.domain.com' IDENTIFIED BY 'Password' //Incorrect Data in user table in mysql database.. | localhost | Username | 14617e5f1090a4a9 | N | N | N | N | N | N | N | N | N| N | N | N | N | N | N| N | N | N | N| N | N| | | | | 0 | 0 | 0 | --snip-- What do I need to do to make those 'Select', 'Update', 'Delete', 'Alter', etc.. to be Y by issuing that SQL Request from above??? What did I do wrong?? Thanks, Scott
MySQL Control Center - One quick question...
One quick question here. I just installed the MySQL Control Center and get the host not allowed connection error. So, do the database have to exist on MySQL Server and set-up permission for that database in order for MySQL Control Center's connection to work?? I'm new here as I switched from DB2. I can access the DB2 Server from DB2 Control Center while there's no database available on that DB2 Server. Scott
How to get MySQL to startup at boot up for AIX 4.3.3???
Hi! I'm using AIX 4.3.3 and I'm still not able to get the MySQLDaemons to start automatically at every bootup. AIX use the inittab, not the init.d Can anyone show me the way? Thanks, FletchSOD