RE: mysql_connect problem

2006-06-28 Thread Ing. Edwin Cruz
http://dev.mysql.com/doc/refman/5.0/en/old-client.html


Regards!
Edwin.


-Mensaje original-
De: WSteffen [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 28 de Junio de 2006 10:29 a.m.
Para: mysql@lists.mysql.com
Asunto: mysql_connect problem


I am using the following in a PHP script:
bash-3.00$ cat mail
?php
$connect = mysql_connect(localhost, bp5am, bp5ampass) or

?

Which gives the following MySQl error:

Warning: mysql_connect() [function.mysql-connect]: Client does not 
support authentication protocol requested by server; consider upgrading 
MySQL client in /var/apache2/htdocs/php_sql/createmovie.php on line 2 Did
not connect successfuly to server.

I presume this is a MySQL Problem. Any ideas as to what is causing this?

Warren Steffen

-- 
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

2006-05-16 Thread Ing. Edwin Cruz
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: MySQL 5 / phpMyAdmin

2006-05-10 Thread Ing. Edwin Cruz
Have a loot on this:
http://dev.mysql.com/doc/refman/5.0/en/old-client.html


Regards!



-Mensaje original-
De: Amer Neely [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 10 de Mayo de 2006 12:39 p.m.
Para: MySQL List
Asunto: MySQL 5 / phpMyAdmin


I've finally got MySQL 5.0 going on my Win2K machine, but phpMyAdmin 
2.8.0.3 is now giving me grief. It gives me this error:

phpMyAdmin tried to connect to the MySQL server, and the server rejected 
the connection.
#1251 - Client does not support authentication protocol requested by 
server; consider upgrading MySQL client

I'm using the same phpMyAdmin config file as when I had a previous 
version of MySQL installed, so I'm stumped on what could be the hangup.

How do I upgrade my MySQL client? phpinfo tells me the API is 3.23.49.

$cfg['Servers'][$i]['auth_type'] = 'config';

I'm not even sure this is a MySQL question, but if someone can provide a 
clue for me that would be great.
-- 
Amer Neely
Home of Spam Catcher
W: www.softouch.on.ca
E: [EMAIL PROTECTED]
Perl | MySQL | CGI programming for all data entry forms.
We make web sites work!

-- 
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: Table doesn't exist?

2006-03-27 Thread Ing. Edwin Cruz
Are the permissions corectly to that file???

Chown mysql:mysql /mysql/data/dbname/tablename.*





-Mensaje original-
De: Sara Woglom [mailto:[EMAIL PROTECTED] 
Enviado el: Lunes, 27 de Marzo de 2006 01:47 p.m.
Para: mysql@lists.mysql.com
Asunto: Table doesn't exist?


I had to shut down my MySQL server (5.0.18) because of an error while
editing a table (Table is full).  I restarted it fine, but in order to do
so I had to delete all my ibdata and ib_logfile files.  Now, I am getting
ERROR 1146: Table 'dbname.tablename' doesn't exist.  Obviously it does
exist, because when I request SHOW TABLES; it lists them all correctly.

What on earth is going on?  I followed the directions for restarting the
server and deleting the log files!  I also ran mysqladmin flush-privileges,
flush-hosts, and refresh.  Please help!




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: OFAC SDN lists

2006-03-22 Thread Ing. Edwin Cruz
Ok, and sorry for my poor explanation and my spanglish

The ofac list is a database with thousands of names of persons who are
forbidden to do transactions like change of dollars to mexican pesos, they
are trying to avoid money laundering, so if somebody try to do a
transaction he have to be searched into ofac list, but the problem is that
the name can be formatted in diferents ways like 'Edwin Cruz' 'Cruz Edwin'
'Edwin E. Cruz' and so on

I've tryed this:

Select * from OFACSDN where match(name) against ('edwin cruz');

And it returns more than 20 names that contain one or both words and i want
to improve my search...

An example:
SELECT NameSDN FROM tofacsdn t where nombre like '%cruz%';
+--+
| NameSDN  |
+--+
| CRUZ REYES, Antonio Pedro|
| CRUZ, Juan M. de la  |
| PEREZ CRUZ, Osvaldo  |
| SANTACRUZ LONDONO, Jose  |
| CAVIEDES CRUZ, Leonardo  |
| SANTACRUZ CASTRO, Ana Milena |
| CASTRO DE SANTACRUZ, Amparo  |
| CASTRILLON CRUZ, Maria Leonor|
| RUELAS MARTINEZ, Jose de la Cruz |
| SANTA CRUZ IMPERIAL AIRLINES |
+--+
10 rows in set (0.02 sec)

How do I have to perform a search in that list with my name 'Edwin Cruz', if
I try with full text I get this:
SELECT NameSDN from tofacsdn WHERE MATCH(nombre) AGAINST ('Edwin cruz')
+--+
| NameSDN  |
+--+
| MUGUTI, Edwin|
| PARRA VELASCO, Edwin Hiulder |
| MUTASA, Didymus Noel Edwin   |
| CRUZ, Juan M. de la  |
| CAVIEDES CRUZ, Leonardo  |
| PEREZ CRUZ, Osvaldo  |
| CASTRILLON CRUZ, Maria Leonor|
| RUELAS MARTINEZ, Jose de la Cruz |
| SANTA CRUZ IMPERIAL AIRLINES |
| CRUZ REYES, Antonio Pedro|
+--+
10 rows in set (0.01 sec)

The closest result that I want is with this query:

SELECT NameSDN from tofacsdn WHERE NameSDN like '%Edwin%' and NameSDN like
'%Cruz%'

But it isn't healthy because what abaut if I provide my name like 'Edwin
C.', I dont know what I am going to do with this... In the worst case I'll
program a script to build a query like above.

I'm using MySQL 5.0.18, php 5.0.5


-Mensaje original-
De: sheeri kritzer [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 22 de Marzo de 2006 08:31 a.m.
Para: Ing. Edwin Cruz
CC: Mysql
Asunto: Re: OFAC SDN lists


repost your question, this time giving an explanation (complete with MySQL
version, platform, queries and results) as to how it doesn't work.

-Sheeri

On 3/15/06, Ing. Edwin Cruz [EMAIL PROTECTED] wrote:
 Hi folks! I'm asking in a web form for clients, those clients I have 
 to search them into OFAC SDN lists( 
 http://www.ustreas.gov/offices/enforcement/ofac/sdn/delimit/index.shtm
 l), if they are into that list they wont be able to do transactions in 
 my system.

 My problem is to perform a good search of the names into that list, I 
 had thought in fulltext, but it appears to not work. Fulltext works 
 with short names.


 does anyone have any suggestion for this?

 Regards!

 Edwin.





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Error 1064: update .....select nested.

2006-03-16 Thread Ing. Edwin Cruz
update TABLE1 a, TABLE2 b set a.FIELD1=b.FIELD2
where column2='[EMAIL PROTECTED]'
And column1 = '[EMAIL PROTECTED]'



Or:


update TABLE1 a, TABLE2 b set a.FIELD1=b.FIELD2
where b.column2=a.column1
And column1 = '[EMAIL PROTECTED]'


Regards!

-Mensaje original-
De: Truong Tan Son [mailto:[EMAIL PROTECTED] 
Enviado el: Miércoles, 15 de Marzo de 2006 07:22 p.m.
Para: mysql@lists.mysql.com
Asunto: Error 1064: update .select nested.


Dear Sir,

MySQL-4.1.12 on RedHat Linux EL4:

mysql update TABLE1 set FIELD1=(select FIELD2  from TABLE2 where 
mysql COLUMN2=
'[EMAIL PROTECTED]') where COLUMN1='[EMAIL PROTECTED]';

ERROR 1064: You have an error in your SQL syntax.  Check the manual that
corresp onds to your MySQL server version for the right syntax to use near
'select FIELD2 from TABLE2 where COLUMN2='[EMAIL PROTECTED]

mysql

For MySQL -5.0.18   is   Ok

Syntax error for version 4.1.12 ?

Thanks you and best regards,
--

-- 
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]



OFAC SDN lists

2006-03-15 Thread Ing. Edwin Cruz
Hi folks! I'm asking in a web form for clients, those clients I have to
search them into OFAC SDN lists(
http://www.ustreas.gov/offices/enforcement/ofac/sdn/delimit/index.shtml), if
they are into that list they wont be able to do transactions in my system.

My problem is to perform a good search of the names into that list, I had
thought in fulltext, but it appears to not work.
Fulltext works with short names.


does anyone have any suggestion for this?

Regards!

Edwin.


RE: mysql_commect or die

2006-03-11 Thread Ing. Edwin Cruz
   mysql_connect(localhost,root) 
or die(Unable to connect to MySQL server);

  $err = mysql_connect(localhost,root);
  if ($err != 0) {

Mysql_connect returns a link to a identifier of the conection, also returns
0 when the conection could not be estabished, 

When you do:
  $err = mysql_connect(localhost,root);
  if ($err != 0) {
echo Error: Unable to connect to MySQL server .mysql_error();
  }
  else{
[code]
  }
Is the same that this:
  $link = mysql_connect(localhost,root) or die(Unable to connect to
MySQL server .mysql_error());
  [code]

The caluse or die()  after mysql_connect only will be launched if there is
an error, if not, the script continues its execution.

The $err variable has 0 if there is an error on that conditions.

And yes! Basically both are doing the same thing but if the conextion is
succesfully stablised it will have a link identifier of the conection.
Regards!


Edwin.



-Mensaje original-
De: fbsd_user [mailto:[EMAIL PROTECTED] 
Enviado el: Sábado, 11 de Marzo de 2006 10:56 a.m.
Para: Mysql
Asunto: mysql_commect or die


   mysql_connect(localhost,root) 
or die(Unable to connect to MySQL server);

  $err mysql_connect(localhost,root);
  if ($err != 0) {


Under what conditions will the die clause be taken.

What is in $err  if there is a error?

Are these 2 statements basically doing the same thing?

 
 

-- 
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: How to Log Warnings and Errors from queries

2006-03-10 Thread Ing. Edwin Cruz
There are some scripts that help us to save logs,

For example: log4php

You write your app and when you're testing it you define a level to save the
errors into a file and display them in your app but in production the client
doesn't have to see the errors, only the developers, so, in your log4php
define that only write the errors into a log file. This is a easy way to
control the errors logs, without re-write your scripts, for example:

Testing: Mysql_query($sql) or die(mysql_error(). $sql);

Production: Mysql_query($sql) or die(saveLog(mysql_error(). $sql));

Regards!


Edwin.



-Mensaje original-
De: Subscriptions [mailto:[EMAIL PROTECTED] 
Enviado el: Viernes, 10 de Marzo de 2006 10:27 a.m.
Para: mysql@lists.mysql.com
Asunto: Re: How to Log Warnings and Errors from queries


In PHP, you can see the error message as follows:

$result = mysql_query($sSQL) or die (br.mysql_error() 
.brbr.$sSQL);

Just change it to write that mysql_error() to a file instead and that'll do 
it.  So, something like:

$result = mysql_query($sSQL) or die ( log_error(mysql_error()) );

where you create that function log_error to write to a file.

Jenifer





- Original Message - 
From: Kishore Jalleda [EMAIL PROTECTED]
To: ryan lwf [EMAIL PROTECTED]
Cc: Dan Nelson [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Friday, March 10, 2006 10:03 AM
Subject: Re: How to Log Warnings and Errors from queries


as you know mysql gives you an error to check your sql syntax when it
doesn't understand a query but does not log it , but you can have your
application (php, perl, etc ) accessing mysql to log any bad/malformed
queries...

Kishore Jalleda

On 3/10/06, ryan lwf [EMAIL PROTECTED] wrote:

 Hi Dan,

 Noted with thanks.

 As such, is there a workaround to log problematic sql queries ran 
 against the mysqld server ?  Do I need to write  separate script to do 
 this ?

 Regards,
 Ryan.

 On 3/10/06, Dan Nelson [EMAIL PROTECTED] wrote:
 
  In the last episode (Mar 08), ryan lwf said:
   I understand that the option log-errors and log-warnings only logs 
   server related internal errors.  How do I enable logging errors 
   from queries executed, so that I can fix the problematic query 
   statement accordingly?
  
   The statement SHOW WARNINGS and SHOW ERRORS does not work on 
   my server with mysqld-4.0.25 binary version.
 
  Those commands appeared in MySQL 4.1.  Before then, warnings were 
  simply counted.
 
  --
 Dan Nelson
 [EMAIL PROTECTED]
 




-- 
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: FOREIGN KEYS

2006-03-10 Thread Ing. Edwin Cruz
I´ve found this on internet:
If you re-create a table which was dropped, it has to have a definition
which conforms to the foreign key constraints referencing it. It must have
the right column names and types, and it must have indexes on the referenced
keys, as stated above. If these are not satisfied, MySQL returns error
number 1005 and refers to errno 150 in the error message string.


Use show create table statement to see table definition (on both)...


Regards!




-Mensaje original-
De: Nanu Kalmanovitz [mailto:[EMAIL PROTECTED] 
Enviado el: Viernes, 10 de Marzo de 2006 01:35 p.m.
Para: mysql@lists.mysql.com
Asunto: FOREIGN KEYS


Hi!
 
Server system SBS (Novell Small Business suite) 6.5 sp 1 with MySQL ver.
4.0.15a, PHP 4.2.3, all of them on same machine.
 
I just finished create a new DB called TIULIM (InnoDB) with 3 tables (Sites,
Tracks  Pathes).
 
Now, using MySQL Query Browser ver. 1.1.15, I'm trying to build FOREIGN
KEYS.
 
The above tool is generating the following query: 
 
ALTER TABLE `tiulim`.`pathes` ADD CONSTRAINT `FK_pathes_1` FOREIGN KEY
`FK_pathes_1` (`Site_ID`)
REFERENCES `sites` (`Site_ID`)
ON DELETE RESTRICT
ON UPDATE RESTRICT,
 ADD CONSTRAINT `FK_pathes_2` FOREIGN KEY `FK_pathes_2` (`Track_ID`)
REFERENCES `tracks` (`Track_ID`)
ON DELETE RESTRICT
ON UPDATE RESTRICT;
 
After executing the query, it display the error message:
 
MySQL Error Number 1005
Can't create table './tiulim/#sql-84_169.frm' (errno: 150)
 
What is the problem? 
How to solve it?
 
TIA
 
Nanu
 
 
 
 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: php and mysql

2006-03-09 Thread Ing. Edwin Cruz
Also be careful with this:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

(after to establish a connection)


Edwin.


-Mensaje original-
De: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED] 
Enviado el: Jueves, 09 de Marzo de 2006 02:17 p.m.
Para: Mary Adel
CC: [EMAIL PROTECTED]; mysql@lists.mysql.com
Asunto: RE: php and mysql


 
If you still have issues after that, then read
http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html

Regards


---
** _/ **  David Logan 
***   _/ ***  ITO Delivery Specialist - Database
*_/*  Hewlett-Packard Australia Ltd
_/_/_/  _/_/_/    E-Mail: [EMAIL PROTECTED]
   _/  _/  _/  _/     Desk:   +618 8408 4273
  _/  _/  _/_/_/  Mobile: 0417 268 665
*_/   **
**  _/    Postal: 148 Frome Street,
   _/ **  Adelaide SA 5001
  Australia 
invent   
---

-Original Message-
From: JC [mailto:[EMAIL PROTECTED] 
Sent: Friday, 10 March 2006 6:42 AM
To: Mary Adel
Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: php and mysql

On Thu, 9 Mar 2006, Mary Adel wrote:

 Thanks for al your help and i di that and now i have another error

 Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (2) my code is as follows:

 ?php
 print hi;
 mysql_connect('localhost', 'root','') or die(mysql_error()); echo 
 Connected to MySQLbr /; print connected;
 ?
 if u can help in this i ll appreciate that a lot


 On Thu, 2006-03-09 at 13:37 -0500, fbsd_user wrote:
 You need a login id and password unless this is test DB added under 
 ID root You have to use the same login id as the one you created 
 the db/table with.

 mysql_connect('localhost', 'Login id', 'pw') or die(mysql_error())

 mysql_connect('localhost', 'root') or die(mysql_error())


 -Original Message-
 From: Mary Adel [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 09, 2006 3:06 PM
 To: mysql@lists.mysql.com
 Subject: php and mysql


 I have a severe problem that php5 cannot connect to mysql and i don't
 know why
 also i am using linux
 here is my peice of code
 :?php
 print hi;
 mysql_connect('localhost', '', '') or die(mysql_error());
 echo Connected to MySQLbr /;
 print connected;
 ?
 if their is any configuration please tell me

 thanks,
 mary


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe: 
 http://lists.mysql.com/[EMAIL PROTECTED]






-- 

hi mary,

take a look at 
http://www.stanton-finley.net/fedora_core_5_installation_notes.html#MySQ
L.

basically, you need to make sure that your mysql server accepts local 
connection.

if you login to your mysql server:
mysql -u root (if no password for root) or
mysql -u root -p (if there is pw for root)

and then:
select user,host,password from mysql.user;

if you don't see an entry for root  localhost, then you need to add it 
in.

hope that help.
JC

-- 
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 General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]