Re: Setting sql_log_bin
Ooh. I can from cmd-line not set any variable not listed there. That explains it all. Yes, I will put the command in the script-file instead then. Thanks alot. /Mattias sheeri kritzer wrote: I don't know what version you're running, but a mysql -? will show you the variables you can set. It's not ALL variables you can set that way, just a few. You will see that the variable you're trying to set cannot be set via a command on the commandline. However, your first command could be to SET SQL_LOG_BIN=0 in your script or whatever you're running. For 5.0.19, here is the snippet of mysql -? that shows the variables you can set: Variables (--variable-name=value) and boolean options {FALSE|TRUE} Value (after reading options) - - auto-rehash TRUE character-sets-dir(No default value) default-character-set latin1 compress FALSE database (No default value) delimiter ; vertical FALSE force FALSE named-commandsFALSE local-infile FALSE no-beep FALSE host (No default value) html FALSE xml FALSE line-numbers TRUE unbufferedFALSE column-names TRUE sigint-ignore FALSE port 0 promptmysql quick FALSE raw FALSE reconnect TRUE socket(No default value) table FALSE debug-infoFALSE user (No default value) safe-updates FALSE i-am-a-dummy FALSE connect_timeout 0 max_allowed_packet16777216 net_buffer_length 16384 select_limit 1000 max_join_size 100 secure-auth FALSE show-warnings TRUE -Sheeri On 5/15/06, Mattias Andersson [EMAIL PROTECTED] wrote: Hi. I can't figure out how to set the session variable SQL_LOG_BIN when using the mysql command-line client. I want to do something like: #mysql -u root -pmypasswd --sql_log_bin = 0 somefile.sql. When trying to run this mysql tells me: /usr/bin/mysql: unknown option '--sql_log_bin' I figure from the documentation that this should be possible: mysql --help ---snip--- -O, --set-variable=name Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value. ---snip--- Perhapps the problem comes from that this is a sessions-variable...? The problem I would like to solve is to not bin-log some special data imports. Any one that could help me figure this out? Thanks alot. Regards, /Mattias -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Mysql and solaris upgrade
Hi, I need to upgrade a server from Solaris 8 to Solaris 10. There is one MySQL server running on it, (the binary mysql-standard-4.1.15-sun-solaris2.8-sparc from mysql.com), do I need to upgrade MySQL as well ? (to mysql-standard-4.1.x-sun-solaris2.10-sparc ?) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Auto Install mySQL
Hi, Just yesterday I have finished doing something very similar ( Apache+PHP+MySQL+Database+PHP-Application ) installer for a demo site. The setup installs the Apache service, the MySQL service and database and start the services. On unistall it removes the services, leaving all clean. The idea is as follows : 1. Create ( and populate ) the database in MySQL on your computer. 2. Create the user needed for your database and remove unneeded users 3. Create an empty folder where to store your application's files ( eg. C:\APP ) 4. Copy the entire MySQL directory from your install into this folder ( eg. C:\APP\MySQL ) 5. Remove any unneeded files from C:\APP\MySQL - you will have to remove other databases, these are stored in c:\APP\MySQL\Data , each database has its own directory. Delete everything but MySQL and Your_database_name folders. In the bin folder you can delete anything but the server you use ( eg. mysqld-nt.exe ) 6. Create or copy a my.ini file in c:\APP\MySQL and write any configurtion preferences in it ( like base_dir, port, innodb prefs, etc ) The installer should : 1. Copy the content of c:\APP folder on client's computer 2. Run the command c:\app\mysql\bin\mysqld-nt.exe --install MySQL --defaults-file=c:\app\mysql\my.ini, this will install the MySQL service 3. Run the command net start MySQL, this will start the MySQL service, MySQL is the name of the service, you can set it to anything you like as long as you use same name after --install and --remove ( eg. --install My_Name_for_mysql_service then net start My_Name_for_mysql_service That would be all, the server will be installed with your database. The ammount of interaction during install depends on how you make the installer ( you can make even a BAT file ). For the installer I have used Inno Setup, available here http://www.jrsoftware.org/isinfo.php , it is free and very easy to use. If you need to uninstall the app, uninstaller should : 1. Stop the MySQL service : net stop MySQL 2. Remove the MySQL service : c:\APP\MYSQL\BIN\mysqld-nt.exe --remove MySQL 3. Delete the c:\APP folder That would be all, hope it helps. -- Puiu Hrenciuc Xentra Development Jim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All, Does anybody have some advise on automating the install of mySQL and our DB on a PC/Laptop with no user interaction required. Does the SETUP.EXE take any paramaters to auto install without the user dialogs? Thanks, Jim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Converting varchar field into primary key
Hello, I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. regards kim -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Converting varchar field into primary key
I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. leading zeros is a typical display requirement. An integer value does not have something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Auto Install mySQL
Hi, If you are installing in windows only thing you run the setup.exe ,after the installation is completed it will prompt for you a default user password that is root (password). and also to create anonymous user. Jim wrote: Hi All, Does anybody have some advise on automating the install of mySQL and our DB on a PC/Laptop with no user interaction required. Does the SETUP.EXE take any paramaters to auto install without the user dialogs? Thanks, Jim -- Thanks Regards, Dilipkumar DBA Support ** DISCLAIMER ** Information contained and transmitted by this E-MAIL is proprietary to Sify Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail notify us immediately at [EMAIL PROTECTED] Watch India vs. England LIVE, Hot videos and more only on Sify Max! Click Here. www.sifymax.com Get to see what's happening in your favourite City on Bangalore Live! www.bangalorelive.in -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Mysql and solaris upgrade
On Tuesday 16 May 2006 02:16 am, Philippe Poelvoorde wrote: Hi, I need to upgrade a server from Solaris 8 to Solaris 10. There is one MySQL server running on it, (the binary mysql-standard-4.1.15-sun-solaris2.8-sparc from mysql.com), do I need to upgrade MySQL as well ? (to mysql-standard-4.1.x-sun-solaris2.10-sparc ?) I'd recommend it simply because if the API/ABI changes on any one of the libraries that MySQL uses during the solaris upgrade, it will fail on you. That said, better safe than sorry. In fact, I'd also ask any solaris newsgroup/mailing list to verify the distribution specific details of the upgrade. -- Chris White PHP Programmer/DB Llama Interfuel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Baffled by error
Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
- Original Message - From: Mike Blezien [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:29 PM Subject: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... I mostly use DB2, not MySQL, and I know that MySQL is a bit looser about what it will allow in its SQL. However, if this were happening in DB2, I'd say that it's because you needed to change the GROUP BY to say: GROUP BY a.account_id, a.company In DB2, the GROUP BY normally needs to include EVERY column/expression from the SELECT clause that is not in a column function. In your case, you are doing a SUM on c.agent_product_time so that means DB2 would expect you to put BOTH of the other two columns from the SELECT in your GROUP BY. Now, if each account_id is associated with a single company, this should give you the result you probably envisioned. But if a given account_id can be associated with more than one company, then your revised query will give you one sum for each COMBINATION of account_id and company. For example: ACCOUNT_IDCOMPANYMINS 001 ABC Co.45 001 DEF Ltd. 90 But maybe that's what you wanted all along? -- Rhino -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
At 12:29 -0500 16/5/06, Mike Blezien wrote: trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Just a wild guess, but... you have 'ON c.account_id = a.id', but you're grouping by a.account_id. Do both of those definitely exist, or should you be grouping by a.id? -- Cheers... Chris Highway 57 Web Development -- http://highway57.co.uk/ It isn't pollution that's harming the environment. It's the impurities in our air and water that are doing it. -- Al Gore, former US Vice President -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Baffled by error
Is because in your select you have c.accound_id and in your group by clause you have a.accound_id Try this: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY c.account_id ORDER BY mins Regards! -Mensaje original- De: Mike Blezien [mailto:[EMAIL PROTECTED] Enviado el: Martes, 16 de Mayo de 2006 12:30 p.m. Para: MySQL List Asunto: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
Tried that, still same error. If I remove the 'AND SUM(c.agent_product_time) = '500' then it works, but I need this in the query. Mike - Original Message - From: Ing. Edwin Cruz [EMAIL PROTECTED] To: 'Mike Blezien' [EMAIL PROTECTED]; 'MySQL List' mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 12:58 PM Subject: RE: Baffled by error Is because in your select you have c.accound_id and in your group by clause you have a.accound_id Try this: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY c.account_id ORDER BY mins Regards! -Mensaje original- De: Mike Blezien [mailto:[EMAIL PROTECTED] Enviado el: Martes, 16 de Mayo de 2006 12:30 p.m. Para: MySQL List Asunto: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
corrected it and still the same error. Mike - Original Message - From: Chris Sansom [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED]; MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 12:56 PM Subject: Re: Baffled by error At 12:29 -0500 16/5/06, Mike Blezien wrote: trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Just a wild guess, but... you have 'ON c.account_id = a.id', but you're grouping by a.account_id. Do both of those definitely exist, or should you be grouping by a.id? -- Cheers... Chris Highway 57 Web Development -- http://highway57.co.uk/ It isn't pollution that's harming the environment. It's the impurities in our air and water that are doing it. -- Al Gore, former US Vice President -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
Mike Blezien wrote: Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins WHERE doesn't understand aggregation. Move the condition SUM(c.agent_product_time) = 500 to a HAVING clause. pb ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 5/15/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
- Original Message - From: Rhino [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED]; MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:56 PM Subject: Re: Baffled by error - Original Message - From: Mike Blezien [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:29 PM Subject: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... I mostly use DB2, not MySQL, and I know that MySQL is a bit looser about what it will allow in its SQL. However, if this were happening in DB2, I'd say that it's because you needed to change the GROUP BY to say: GROUP BY a.account_id, a.company Sorry, I didn't notice the name in the SELECT. Therefore, the GROUP BY should be: GROUP BY a.account_id, a.name, a.company In DB2, the GROUP BY normally needs to include EVERY column/expression from the SELECT clause that is not in a column function. In your case, you are doing a SUM on c.agent_product_time so that means DB2 would expect you to put BOTH of the other two columns from the SELECT in your GROUP BY. Oops, that should be: DB2 would expect you to put ALL of the other THREE columns from the select in your GROUP BY. Now, if each account_id is associated with a single company, this should give you the result you probably envisioned. But if a given account_id can be associated with more than one company, then your revised query will give you one sum for each COMBINATION of account_id and company. For example: ACCOUNT_IDCOMPANYMINS 001 ABC Co.45 001 DEF Ltd. 90 Oops, that should be: Now, if each account_id is associated with a single name and company, this should give you the result you probably envisioned. But if a given account_id can be associated with more than one company and the company with more than one name, then your revised query will give you one sum for each COMBINATION of account_id, name and company. For example: ACCOUNT_IDNAME COMPANYMINS 001 Bob ABC Co.45 001 DaveABC Co.20 001 Mary DEF Ltd. 90 001 Jane DEF Ltd. 190 But maybe that's what you wanted all along? -- Rhino -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
Peter, - Original Message - From: Peter Brawley [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:07 PM Subject: Re: Baffled by error Mike Blezien wrote: Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins WHERE doesn't understand aggregation. Move the condition SUM(c.agent_product_time) = 500 to a HAVING clause. pb How would this query be constructed with the HAVING clause, not real fimilar with this type of clause. thx's Mike -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
Mike, How would this query be constructed with the HAVING clause, not real fimilar with this type of clause. SELECT a.id, a.name, a.company, SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 GROUP BY a.account_id HAVING SUM(c.agent_product_time) = 500 ORDER BY mins; PB - Mike Blezien wrote: Peter, - Original Message - From: Peter Brawley [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:07 PM Subject: Re: Baffled by error Mike Blezien wrote: Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins WHERE doesn't understand aggregation. Move the condition SUM(c.agent_product_time) = 500 to a HAVING clause. pb How would this query be constructed with the HAVING clause, not real fimilar with this type of clause. thx's Mike -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 5/15/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
MySQL, PHP and Yahoo webhosting
I'm fairly new to all this and duing everything step by step... I made my first (test) php site - and it works... then, i have this script where i'm supposed to find out if MySQL and PHP talk with each other. and there i get the answer Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46) and the tem-folder in my page root is empty, too. But i have PHPMyAdmin and i can log in there. i just have no clue where the files are and how i change it so that i finaly can start learning by doing... Thanks so much for the help... steve -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/338 - Release Date: 5/12/2006
Re: Baffled by error
Peter, - Original Message - From: Peter Brawley [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:25 PM Subject: Re: Baffled by error Mike, How would this query be constructed with the HAVING clause, not real fimilar with this type of clause. SELECT a.id, a.name, a.company, SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 GROUP BY a.account_id HAVING SUM(c.agent_product_time) = 500 ORDER BY mins; PB Much appreciated and it works prefectly now... :) Thx's Mike - Mike Blezien wrote: Peter, - Original Message - From: Peter Brawley [EMAIL PROTECTED] To: Mike Blezien [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 1:07 PM Subject: Re: Baffled by error Mike Blezien wrote: Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins WHERE doesn't understand aggregation. Move the condition SUM(c.agent_product_time) = 500 to a HAVING clause. pb How would this query be constructed with the HAVING clause, not real fimilar with this type of clause. thx's Mike -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Converting varchar field into primary key
I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. leading zeros is a typical display requirement. An integer value does not have something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! The manual states (among other things) declaring a column: int(6) zerofill will left pad the column with zeros. 003 will become 03. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Converting varchar field into primary key
I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. leading zeros is a typical display requirement. An integer value does not have something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! The manual states (among other things) declaring a column: int(6) zerofill will left pad the column with zeros. 003 will become 03. On retrieval, compare or what? 003 = 03 = 3 as far as I know. Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Converting varchar field into primary key
Jonathan Mangin wrote: I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. leading zeros is a typical display requirement. An integer value does not have something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! The manual states (among other things) declaring a column: int(6) zerofill will left pad the column with zeros. 003 will become 03. This won't work with his 3, 4, and 6 character examples. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Converting varchar field into primary key
- Original Message - From: gerald_clark [EMAIL PROTECTED] To: Jonathan Mangin [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 3:08 PM Subject: Re: Converting varchar field into primary key Jonathan Mangin wrote: I'm creating a new MySQL database from an existing Filemaker db. My problem is that some of the existing 'numbers' in one column (it was a text field in FMP) have leading zeros. eg: 003, 0007, 012, 001234. I need to maintain these numbers 'as is' - complete with zeros. I've tried all the numeric data types and they all seem to strip these leading zeros. Is it possible to have a numeric field type which will maintain those zeros? I want this column to become the primary key. leading zeros is a typical display requirement. An integer value does not have something as leading zeros. Why not make the VARCHAR the PK and keep the datatype? Martijn Tonies Database Workbench - development tool for MySQL, and more! The manual states (among other things) declaring a column: int(6) zerofill will left pad the column with zeros. 003 will become 03. This won't work with his 3, 4, and 6 character examples. -- Leaving out zerofill will left pad with spaces. (Tried to encourage the OP to RTM.) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Restore Problem
I've got a backup that is scheduled by MySQL Administrator, which appears to be happening without a problem. However, I just tried to restore that backup on my machine, and the data doesn't appear to be restoring properly. The original database was on our web server, where the backup occurs each night automatically. I've downloaded the backup to my machine, and tried to restore it using MySQL Administrator, and it goes through the motions, but the data has not been changed in my database here. What could I be doing wrong here? Thanks, Jesse
Re: MySQL, PHP and Yahoo webhosting
What does your script look like? Code? Ed On May 13, 2006, at 5:46 PM, Steve wrote: I'm fairly new to all this and duing everything step by step... I made my first (test) php site - and it works... then, i have this script where i'm supposed to find out if MySQL and PHP talk with each other. and there i get the answer Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46) and the tem-folder in my page root is empty, too. But i have PHPMyAdmin and i can log in there. i just have no clue where the files are and how i change it so that i finaly can start learning by doing... Thanks so much for the help... steve -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/338 - Release Date: 5/12/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Baffled by error
Try this SELECT c.account_id, a.name,a.company, SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 GROUP BY a.account_id HAVING SUM(c.agent_product_time) = '500' ORDER BY mins You have to do the SUM with the GROUP BY before you can test the criteria -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 10:30 AM To: MySQL List Subject: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL, PHP and Yahoo webhosting
Hi. call this function, phpinfo(); in a *.php file. That should return alot of usesfull info. Make sure the mysql extension is being loaded. If so check the value of the following php config var: ; Default socket name for local MySQL connects. If empty, ; uses the built-in ; MySQL defaults. mysql.default_socket = /var/lib/mysql/mysql.sock You may need to change the setting in php.ini to tell php to use the correct socket to talk to mysql on. HTH Keith In theory, theory and practice are the same; in practice they are not. On Sat, 13 May 2006, Steve wrote: To: mysql@lists.mysql.com From: Steve [EMAIL PROTECTED] Subject: MySQL, PHP and Yahoo webhosting I'm fairly new to all this and duing everything step by step... I made my first (test) php site - and it works... then, i have this script where i'm supposed to find out if MySQL and PHP talk with each other. and there i get the answer Error 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46) and the tem-folder in my page root is empty, too. But i have PHPMyAdmin and i can log in there. i just have no clue where the files are and how i change it so that i finaly can start learning by doing... Thanks so much for the help... steve -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.6/338 - Release Date: 5/12/2006 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Baffled by error
Gordon, thank you, works prefectly now. Mike - Original Message - From: Gordon [EMAIL PROTECTED] To: 'Mike Blezien' [EMAIL PROTECTED]; 'MySQL List' mysql@lists.mysql.com Sent: Tuesday, May 16, 2006 3:17 PM Subject: RE: Baffled by error Try this SELECT c.account_id, a.name,a.company, SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 GROUP BY a.account_id HAVING SUM(c.agent_product_time) = '500' ORDER BY mins You have to do the SUM with the GROUP BY before you can test the criteria -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 10:30 AM To: MySQL List Subject: Baffled by error Hello, MySQL 4.1.12 trying to figure out why I keep getting this error with the following query: SELECT c.account_id,a.name,a.company,SUM(c.agent_product_time) AS mins FROM account a LEFT JOIN calls c ON c.account_id = a.id WHERE c.calldate = DATE_SUB(NOW(),INTERVAL 14 DAY) AND c.agent_id = 9 AND SUM(c.agent_product_time) = '500' GROUP BY a.account_id ORDER BY mins ERROR: # - Invalid use of group function Any help appreciated... Mike(mickalo)Blezien === Thunder Rain Internet Publishing Providing Internet Solution that Work http://www.thunder-rain.com === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]