Jan
28
2008
0

Select a raondom row

Select a random row with mysql:

select column_name from table_name order by rand() limit 1

Select a random row with SQL Server

select top 1 column_name from table_name order by newid()

Written by hkai in: MySQL, SQL Server 2005 |
Apr
20
2007
0

ERROR 1251: Client does not support authentication protocol requested by server

MySQL 5.0 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the following message:
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

You can set the password of the user with old_password() function
set password for ’some_user’@’some_host’ = OLD_PASSWORD(’newpwd’);
FLUSH PRIVILEGES;

Written by hkai in: MySQL |
Oct
13
2006
0

mysql query log

mysql can log all the query to a log file to easy the debug.

in the start up script of mysql, add “–log=query.log”

on windows, it’ll be like this:

mysqld –defaults-file=..\my.ini –log=query.log

and you’ll able to find the querylog at c:\mysql\data

Written by hkai in: MySQL |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes