1. Log in as the mysql root user. (Of course you have a password for root — right?!
$ mysql -u root -p
2. Create the database (Substitute "databasename" with the name you want for your database.)
mysql> create database databasename
3. Create at least one user for the database. (Substitute "databasename" with the name of your database, "databaseuser" with the name you want for your database user, and "userpassword" with the password you want for your user.)
mysql> grant all privileges on databasename.*
> to databaseuser@localhost
> identified by userpassword;
(Don't forget the .* and the @localhost ... like i always do!)
Note: Never write your scripts using root as the database user — unless you love hackers!
All content not copyright by anyone else is
copyright © 2003–2012 James Walker.
License for use is the GNU Free Documentation License.
Find it:
here in the
License directory
or
at the Free Software Foundation,
www.fsf.org