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()
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()
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;
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
Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes