Linux Project #3: Usefult things to know when starting with mysql.
by Gilbert Keith
2. How to create a database, and then USE it before you can do anything else with it: http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve
Ultimately, I guess, I’m trying to make this part easy.
SO to recap-
1. login as:
mysql -u root -p (then enter password);
2. use the create user command thusly:
create user ‘user_name’@’server’ IDENTIFIED BY ‘password’;
3. to grant privileges:
a. create the database as root:
create database DATABASE_NAME;
b. use the database
c. grant your newly created user all the privileges.
grant all privileges on DATABASE_NAME.* to ‘user_name’@’server’ WITH GRANT OPTION;
Edit: in step 3C there needs to be a * to grant privileges for all tables. how silly of me to not realize that!