MySQL Notes

These notes are for my own convenience - to have the information I want most of the time on a single page. If you don't already have the O'Reilly MySQL & mSQL book... it's a very nice reference.

Following installation (or to rebuild access rights database from scratch)

To check that MySQL is running

If MySQL is not running, start with

or with logging...

Changing 'root' password (default administrative account - not related to root on your machine)

Note: the -p in all commands below tell MySQL to prompt for a password

Also... you might want to use the -u switch to send a command as a specifi user (might be important for access)

Creating a database

Deleting a database

Shutting down mysqld

Displaying table structure for a particular database (-d keeps actual table data from showing)

To recreate tables, etc... from mysqldump output

Reloading access tables for server

MySQL administration - global access privileges

Every user that connects to MySQL must be added to the user table in the mysql database. This table defines global privileges for the server (not specific database access). Access privileges to specific databases are define in the db table.

Typical SQL statement to add a user to table:

MySQL Administration - access privileges for specific databases

Access rights for specific databases are defined in the db table in the mysql database.

Typical SQL statement to add a user to table: