RE: Client does not support authentication protocol requested by server
I would have a look here: http://dev.mysql.com/doc/refman/5.0/en/old-client.html Secondly, if I'm not mistaking, the some_host should be localhost if you want the script only to be able to connect from the local computer and % if you want the connection to be possible from any possible host. At least that is what I think... Regards -Oorspronkelijk bericht- Van: John Berman [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 9 oktober 2007 23:47 Aan: mysql@lists.mysql.com Onderwerp: Client does not support authentication protocol requested by server Hi We have php 4.3.4 and mysql 5 My test script produces this Client does not support authentication protocol requested by server http://www.jewishgen.org/cemetery/connect-test.php Research suggests that I can upgrade php or SET PASSWORD FOR [EMAIL PROTECTED] = OLD_PASSWORD ('') So I did this but it makes no difference, pointers appreciated Regards John B No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.488 / Virus Database: 269.14.5/1058 - Release Date: 08/10/2007 16:54 -- 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]
convert duration(mediumint) to hours and minutes
Hello list, I have a table events in a database that has a field named duration. This field is a mediumint containing an amount of minutes (eg 65, 87, 10368) Now I need these to be outputted into a h:mm (so 65 will be represented as 1:05) My complete query is: select YEAR(events.workdate) as theyear, (sum(events.duration)/60),clients.name, persons.name from events, persons, clients where events.personid= persons.personid and events.clientid= clients.clientid group by clients.name, events.personid, theyear; this does, off course not give me the wanted result. How can I convert these numerical entries to hh:mm in my query? (days do not matter, I just need hours and minutes, thx) Regards and thanks, Reinhart Viane D-studio Graaf van Egmontstraat 15/3 2800 Mechelen [EMAIL PROTECTED] +32(0)15 44 89 01 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
joining tables
Table1: events Durationworkdateclientidpersonid 60 2006-01-03 1 51 48 2006-01-03 2 51 167 2006-01-03 4 51 Table2: clients Clientidname 1 client1 2 client2 3 client3 4 client4 select SUM(duration) as totaltime, name from events left join clients on (events.clientid=clients.clientid) where MONTH(events.workdate)=1 and YEAR(events.workdate)=2006 and DAY(events.workdate)=3 and events.personid=51 group by events.clientid desc I used this query and this give s me this result: Totaltime name 60 client1 48 client2 167 client4 But what I need is a result like this: Totaltime name 60 client1 48 client2 0 client3 167 client4 So even the clients who have no entry in events on that day, but they have an event in that specific month and year should be shown with a 0 value. Any help really appreciated. Thx in advance -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
myodbc version 3.21.X
Hey list, I'm am currently looking for myODBC 3.21.X but can't seem to find a suited downloadsite. Does anyone know a link to this version? Thanks in advance, Reinhart Viane
change field to auto increment
Hey list, I need a query that checks if a certain table column has type auto-increment If not set it to auto increment, else do nothing. Let's say I have the table objects (object_id, object_name) in which object_id is the primary field. Now check to see if object_id is auto_increment and if not set it auto_increment Can anyone help me on this? I've been looking into the manual but I can't get it right: Alter table objects change object_id type auto_increment Thx in advance, Reinhart
RE: change field to auto increment
Great!! Thx I looked into the manual and the refer to the create syntax concerning auto_increment. The one thing I did not get was the fact I have to 'recreate' the column definition and can not just add something to it. It works great now! The for the effort of replying :) Greetings, Reinhart Viane Btw, how do you show your tables layout like you did in this mail? -Oorspronkelijk bericht- Van: Michael Stassen [mailto:[EMAIL PROTECTED] Verzonden: woensdag 1 juni 2005 16:47 Aan: [EMAIL PROTECTED] CC: mysql@lists.mysql.com Onderwerp: Re: change field to auto increment Reinhart Viane wrote: Hey list, I need a query that checks if a certain table column has type auto-increment If not set it to auto increment, else do nothing. Let's say I have the table objects (object_id, object_name) in which object_id is the primary field. Now check to see if object_id is auto_increment and if not set it auto_increment Can anyone help me on this? I've been looking into the manual but I can't get it right: Alter table objects change object_id type auto_increment Thx in advance, Reinhart You can find out if objects.object_id is set to AUTO_INCREMENT in a couple of ways. Use DESCRIBE tablename http://dev.mysql.com/doc/mysql/en/describe.html to see info about all the columns: mysql DESCRIBE objects; +---+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-++ | id| int(10) unsigned | | PRI | NULL| auto_increment | | name | char(30) | YES | MUL | NULL|| +---+--+--+-+-++ 2 rows in set (0.00 sec) or use DESCRIBE tablename colname to see info about a specific column: mysql DESCRIBE objects id; +---+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-++ | id| int(10) unsigned | | PRI | NULL| auto_increment | +---+--+--+-+-++ 1 row in set (0.01 sec) or use SHOW CREATE TABLE tablename http://dev.mysql.com/doc/mysql/en/show-create-table.html: mysql SHOW CREATE TABLE objects\G *** 1. row *** Table: objects Create Table: CREATE TABLE `objects` ( `id` int(10) unsigned NOT NULL auto_increment, `name` char(30) default NULL, PRIMARY KEY (`id`), KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.00 sec) The last is probably best for your purposes. To change a column definition using ALTER TABLE, you have to give the complete new column definition, you can't simply add an attribute. If objects.id in my example above had not been AUTO_INCREMENT: ALTER TABLE objects CHANGE id id int(10) unsigned NOT NULL auto_increment; That is, I took the line from SHOW CREATE TABLE for id, added the AUTO_INCREMENT attribute, and used that as the new column definition. See the manual for details on ALTER TABLE syntax http://dev.mysql.com/doc/mysql/en/alter-table.html. Michael -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.3.3 - Release Date: 31/05/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
percentage query
Hey all, I have some difficulties building a querie. Table objects type_id area Table 4dtypes type_id name what I need is a query who gives me the folowing result: name (grouped by type_id) - sum of area -- percentage of total area so I need to group the records on type_id, but how can I get the percentage? This is my query till now: SELECT 4dtypes.name, Sum(objects_0.area) FROM 4dtypes, objects where 4dtypes.type_id=objects.type_id GROUP BY 4dtypes.type_id I hope you understand, Thx in advance. Reinhart
RE: Remove 1st 3 Chars
Look at the substring example here http://dev.mysql.com/doc/mysql/en/string-functions.html Regards, Reinhart Viane -Oorspronkelijk bericht- Van: shaun thornburgh [mailto:[EMAIL PROTECTED] Verzonden: woensdag 11 mei 2005 13:30 Aan: mysql@lists.mysql.com Onderwerp: Remove 1st 3 Chars Hi, is it possible to alter fields in a column by removing the first three characters? i.e. change 100123456789 to 123456789 Thanks for your help -- 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 Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
show all running queries on linux
Hey list, How can I see the running queries on a linux comp? Thx Reinhart
RE: Help with LIKE
Maybe you better do something like: SELECT * FROM woorden WHERE % woord % LIKE string -Oorspronkelijk bericht- Van: Mevershosting.nl [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 18 maart 2005 16:11 Aan: mysql@lists.mysql.com Onderwerp: Help with LIKE Dear list, I need some help on this, I have a DB with one table The table (woorden) contains 1 field (woord) varchar(255) What i would like to be able to do is. SELECT * FROM woorden WHERE string LIKE % woord % so i need the fields in the table which fit into the string i submit. example: The string is: housewife and the result i would like to have is: house wife I hope somebody can help me. Greetings, Richard Mevers -- 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 Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Best way to order mysql results with limit
Hey list I have a table like this: Act_name Act_type_id Act_date Heyhey 1 22-06-05 Aloha 2 22-06-05 Tralala 2 22-06-05 Wuhu 1 22-06-05 Hehe 3 22-06-05 Olalal 3 22-06-05 Pompom 1 22-06-05 Wuhu 2 22-06-05 Now i want to do a select which returns the two most near (in the future) activities of each act_type_id Is there a way to do this cleanly or should I better do a full select and only get what I want with php? Thx in advance. Btw Im using MySQL 4.0.1-alpha-nt Reinhart Viane D-studio [EMAIL PROTECTED] Graaf van Egmontstraat 15/3 2800 Mechelen Tel: +32 (0)15 448 901 STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
list
Checking if this message gets through Reinhart Viane D-studio [EMAIL PROTECTED] Graaf van Egmontstraat 15/3 2800 Mechelen Tel: +32 (0)15 448 901 STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 22/02/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
compare dates
Hey list I need a query like this: Select * from activities where act_date = today or any day in the future I have made it work like this: Sselect * from activities where UNIX_TIMESTAMP() UNIX_TIMESTAMP(act_date) Problem is with this thing I have to manually add 23:59:59 to each activity date I enter in the database. Im sure there is a better way so I can set my column type to DATE instead of DATETIME now and use a better query. Any help? Thx Reinhart No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: compare dates
Thank you very much, that indeed did the trick. Concerning datetime type: Eg. in a forum if someone posts a message the date and the time is stored and shown of that message. I suppose they use timestamp in that case? -Oorspronkelijk bericht- Van: Gabriel PREDA [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 18 februari 2005 12:30 Aan: [EMAIL PROTECTED]; mysql@lists.mysql.com Onderwerp: Re: compare dates Let me assure you that DATETIME is the worst choice ever... because it need 8 bytes per record... TIMESTAMP uses only 4 DATE uses only 3, so does TIME YEAR is the smallest... 1 byte. You can do: SELECT * FROM activities WHERE act_date = NOW() But for optimization... you should not compute in WHERE... so this is faster.. .but there are 2 queries: SET @this_moment = NOW(); SELECT * FROM activities WHERE act_date = @this_moment Gabriel PREDA www.amr.ro - Original Message - From: Reinhart Viane To: mysql@lists.mysql.com Sent: Friday, February 18, 2005 1:10 PM Subject: compare dates Hey list I need a query like this: Select * from activities where act_date = today or any day in the future I have made it work like this: Sselect * from activities where UNIX_TIMESTAMP() UNIX_TIMESTAMP(act_date) Problem is with this thing I have to manually add 23:59:59 to each activity date I enter in the database. I'm sure there is a better way so I can set my column type to DATE instead of DATETIME now and use a better query. Any help? Thx Reinhart -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Cannot connect to local server problem
Did you reboor after install? -Original Message- From: Leandro Melo [mailto:[EMAIL PROTECTED] Sent: woensdag 15 december 2004 14:51 To: lista mysql Subject: Cannot connect to local server problem Hi, i built an application which uses MySQL 4.0.17 using Windows XP Professional. Tomorrow, i need to present the application to my client, so i preparing my enviroment in a laptop, which runs Windows 2000. When i installed MySQL 4.0.17 and tried to run the client from command line, i got the following error message: ERROR 2003: Can't connect to MySQL server on 'localhost' (10061) I don't remember this problem when i first installed the db in windows XP (or maybe i just don't remeber solving it). What am i missing? How do i fix that? Thanks, ltcmelo ___ Yahoo! Mail - Agora com 250MB de espaço gratuito. Abra uma conta agora! http://br.info.mail.yahoo.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]
query data from two tables
Table chat_online: session (varchar) activity (datetime) Table persons persons_region_int(int) Table regions region_id region_name On a page i list all persons which are in the chat_online dbase and within a certain period: $limit_time = time() - 130; // 2 Minutes time out. 60 * 2 = 120 $sqlchatonline = SELECT * FROM chat_online WHERE UNIX_TIMESTAMP(activity) = $limit_time AND (sessionid!='.session_id().'); $resultchatonline=mysql_query($sqlchatonline) or die (mysql_error()); $chatvisits = mysql_num_rows($resultchatonline); while($rowchatonline = mysql_fetch_object($resultchatonline)){ $chattersessionid=$rowchatonline-sessionid; //get the username, userid, mainpicid from the online chatter $getinfo= select * from persons where person_session_id='$chattersessionid'; $resultgetinfo = mysql_query($getinfo) or die (mysql_error()); $rowgetinfo= mysql_fetch_array($resultgetinfo); echo $rowgetinfo['person_nick']; } Now i want these online chatters to be listed by person_region_int: something like: region A chatter1 chatter2 region B none region C chatter3 chatter4 How do i do this? And a second question: I have created a menu box which lists all regions, if a option is selected by the user, i only want to show the online chatters of the selected region (selecting an option defines a variable $region which holds the region_id) Something like: if ($region) { $sqlchatonline = SELECT * FROM chat_online, persons WHEREUNIX_TIMESTAMP(chat_online.activity) = $limit_time AND (chat_online.sessionid!='.session_id().' AND (persons.persons_region_int='$region'); } This doe not give me the correct result: it shows all online chatters * total amount of users of that region. It should be all online chatters from that specified region. What can be the correct syntax? Thx in advance Reinhart Viane -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]