1--TEST-- 2mysqli_report(), change user, MySQL 5.6+ 3--EXTENSIONS-- 4mysqli 5--SKIPIF-- 6<?php 7require_once 'connect.inc'; 8 9if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 10 die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 11 $host, $user, $db, $port, $socket)); 12 13if (mysqli_get_server_version($link) < 50600) 14 die("SKIP For MySQL >= 5.6.0"); 15 16?> 17--FILE-- 18<?php 19 require_once 'table.inc'; 20 21 /* 22 Internal macro MYSQL_REPORT_ERROR 23 */ 24 mysqli_report(MYSQLI_REPORT_ERROR); 25 26 mysqli_change_user($link, "0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789", "password", $db); 27 28 mysqli_report(MYSQLI_REPORT_OFF); 29 30 if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) 31 printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 32 $host, $user, $db, $port, $socket); 33 34 mysqli_change_user($link, "This might work if you accept anonymous users in your setup", "password", $db); 35 36 print "done!"; 37?> 38--CLEAN-- 39<?php 40require_once "clean_table.inc"; 41?> 42--EXPECTF-- 43Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d 44done! 45