Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special characters in MySql Password [closed]

Our app continues to have problem with MySql passwords. We would like to create a function to test for password validity before it is presented to the database.

Can anyone direct me to guidelines for MySql passwords involving these 2 topics:

  1. password max length (hash is stored as 16 bit varchar which does not mean 16 is max length)
  2. which punctuation / special characters can be used in a MySql password?
like image 605
csi Avatar asked Jan 21 '14 18:01

csi


1 Answers

I'm using MariaDB 10.0.13 - the '\' character is a bit special. If defining a password using PASSWORD('text'), make sure to escape use of '\'.

Example: set password for user@localhost = PASSWORD('\\');

You can then use a single '\' for the password with mysql: mysql -u user --password='\'

like image 145
EricH Avatar answered Sep 23 '22 00:09

EricH