MySQL UPDATE with random number between 1-3

UPDATE tableName SET columnName = FLOOR( 1 + RAND( ) *3 );

按roundorder正序排列,随机取最小的一列

select * from roundmodel where roundorder>'1' ORDER BY roundorder, RAND() limit 0,1

来源:https://stackoverflow.com/questions/14865632/mysql-update-with-random-number-between-1-3

ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

$ sudo mysql -u root # I had to use “sudo” since is new installation
https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost