If you need to create random string (i.e., to be used as password) in MySQL, you can easily do it with a command like this:


UPDATE `user` SET `password` = SUBSTRING(MD5(RAND()) FROM 1 FOR 8) WHERE
 1


This commend creates a string of random characters, in the range a-z and 0-9, of the lenght of 8 (you can easily modify it to get shorter or longer strings)


Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • MySQL
  • 2 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

 How To Insert a Carriage Return in a PHP String

If you need to insert a Carriage Return in a string in PHP: Carriage return is: "\r"  But...

 How to Create a phpinfo page

The phpinfo() function outputs a huge amount of information about the system you're using, such...

 How To Make a Redirect in PHP

If you want that a page redirects automatically the user to a certain page or site (let's say,...

 How To Configure Easy WP SMTP Plugin To Use Gmail SMTP Service

Easy WP SMTP is a popular and free plugin for WordPress to send email(s) by an authenticated SMTP...

 How to automate MySQL backup using R1soft-Idera backup

Plain R1soft-Idera backup does not directly support mySQL database backup. But with this...