MySQL database snippets

// quick connection test

$connect = mysql_connect($host, $user, $pass) or die('Unable to connect to host');
mysql_select_db($name) or die('Could not open the database');

// update old style passwords

SET PASSWORD FOR 'user'@'host' = PASSWORD('pass');
FLUSH Privileges;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>