Register now and start sharing your code snippets.
-->

How to reset the MySQL root password

Shell Script (Bash) posted about 1 year ago by christian

I just happened to lock myself out of MySQL, but luckily I have root access to the server so I can reset it easily by first shutting down MySQL:

   1  /etc/init.d/mysql stop

And then creating a MySQL init file with the desired password:

   1  $ echo "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('1234');" >> /tmp/mysql_init.txt

Starting MySQL with the —init-file parameter like this resets the password:

   1  $ mysqld_safe --init-file=/tmp/mysql_init.txt

Remember to delete the file:

   1  rm /tmp/mysql_init.txt

Tagged mysql, password, reset

Reset CSS rules to render HTML identically in all browsers

CSS posted about 1 year ago by christian

These CSS rules remove most, if not all, browser specific styles from common HTML elements. Your page will look almost identical in all browser when using these CSS rules. Note that this is a combination of Tantek Celik’s undohtml.css and YUI ’s reset.css.

   1  /** START BLATANT RIP FROM Tantek Celik's undohtml.css */
   2  
   3  /* link underlines tend to make hypertext less readable, 
   4     because underlines obscure the shapes of the lower halves of words */
   5  :link,:visited { text-decoration:none }
   6  
   7  /** END BLATANT RIP FROM Tantek Celik's undohtml.css */
   8  
   9  /** START BLATANT RIP FROM YUI's reset.css */
  10  
  11  body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {  
  12    margin:0; 
  13    padding:0; 
  14  } 
  15  table { 
  16    border-collapse:collapse; 
  17    border-spacing:0; 
  18  } 
  19  fieldset,img {  
  20    border:0; 
  21  } 
  22  address,caption,cite,code,dfn,em,strong,th,var { 
  23    font-style:normal; 
  24    font-weight:normal; 
  25  } 
  26  ol,ul { 
  27    list-style:none; 
  28  } 
  29  caption,th { 
  30    text-align:left; 
  31  } 
  32  h1,h2,h3,h4,h5,h6 { 
  33    font-size: 1em; 
  34    font-weight:normal; 
  35  } 
  36  q:before,q:after { 
  37    content:''; 
  38  } 
  39  abbr,acronym { 
  40    border:0; 
  41  } 
  42  
  43  /** START BLATANT RIP FROM YUI's reset.css */

Tagged css, reset, browser, compatibility