After searching for valuable info and deleting accidentally valuable info from the database I thought I'll post a small tutorial here. the mysql manual is so full of senseless info that one searches for an hour to find anything:
0) First, you have to start the server itself, using the mysqld.exe
1) If you have forgotten the password or deleted all users with privileges:
start mysqld manually using the --skip-grant-tables :
mysqld --skip-grant-tables
This option causes the server not to use the privilege system at all. This gives everyone full access to all databases! (You can tell a running server to start using the grant tables again by executing mysqladmin flush-privileges or mysqladmin reload).
Afterwards (after skipping grant tables): to tell the server to reload the grant tables:
mysqladmin flush-privileges
or
mysqladmin reload
2) To log in:
a) mysql -h hostname -u username -p
you will be asked for the password
or
b) mysql -h hostname -u username -pPASSWORD (no spaces in -pPASSWORD !!!!)
3) Shutdown:
a) if user with all privileges and NO password:
mysqladmin -u username shutdown
b) if user with all privileges and AN EXISTING password:
mysqladmin -u username -pPASSWORD shutdown (no spaces in -pPASSWORD !!!!)
name and password are case-dependent
4) create new users, set privileges:
best of all is to use phpMyAdmin (log in as a user with full privileges, to be set currently in the config.inc.php3 of phpMyAdmin. the database is mysql, the "user" table