The special character exclamation mark (!) in MySQL user password. The use of

  • 2020-06-23 02:07:57
  • OfStack

Use the exclamation point (!). A method of disabling user terminal entry.


mysql> grant all privileges on wubx.* to ' wubx'@'172.16.100.185 ' identified by ' fd52!wubx & ,';
Query OK, 0 rows affected (0.00 sec)
mysql>quit;
#mysql -h 172.16.100.185 -u wubx -pfd52!wubx & ,
-bash: !wubx@,: event not found

Look carefully 1, originally he put! The following string is executed as a command. Another management end of Navicat was tried, and another one had abnormal password.

Is it possible to use the program under test 1? Write 1 PHP under test 1.


$link = mysql_connect('172.16.100.185 ' ,'wubx','fd52!wubx & ,');
if (!link){
die( ' Could not connect:'.mysql_error());
}
echo ' Connected successfully';mysql_close($link);
?>
#php testdb.php
Connected successfully

Also see the program can be normal recognition.
PHP can still pass OK.


Related articles: