Posted By

jwaldeck on 02/14/11


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jeremydouglass


MySQL from Command Line


 / Published in: MySQL
 

  1. mysql
  2. SHOW DATABASES;
  3. mysql -u root -p
  4. SET PASSWORD FOR root@localhost=PASSWORD('#PasswordHere#');
  5. FLUSH PRIVILEGES;
  6. CREATE DATABASE #NAME#;
  7. DROP DATABASE #NAME#;
  8.  
  9. <!-- Granting user privileges -->
  10. GRANT ALL PRIVILEGES ON #databaseName#.*
  11. TO 'username'@'localhost'
  12. IDENTIFIED BY '#userpassword';
  13. SHOW GRANTS FOR '#username#'@'localhost'
  14.  
  15. mysql -u #UserName# -p #databaseName#
  16. SHOW TABLES;

Report this snippet  

You need to login to post a comment.