Tech Journal Back to Tech Journal

mySQL: Commonly used commands

Granting full permissions to use/modify a database to a given user:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON database-name.* TO user-name@hostname IDENTIFIED BY 'password';
Creating a new database
mysqladmin create database-name -or- (after you login to MySQL) CREATE DATABASE database-name;
Changing the password for username (you will be prompted for the old password)
mysqladmin -p -u username password new-password
If that didn't work, try using the 'no passwords' mode
mysqladmin -u username password new-password
Last updated on 2000-08-09 14:00:00 -0700, by Shalom Craimer

Back to Tech Journal