[[ch-database-reference]]
== Database configuration

(((@MySQL@, root password)))
(((Database, root password)))
Initially the *root* password for the database is the same as that of
the *admin* user used to to connect to your machine via SSH or SFTP.
To change this you can use the @phpMyAdmin@ interface.

As a general rule, each application should have its own username and
access rights, to make sure that there is a degree of separation
between all the applications on a server.  This can all be done
through the @phpMyAdmin@ interface.

=== Adding a user with remote privileges
(((@MySQL@, adding a remote user)))
(((Database, adding a remote user)))

There are two ways to do this, either using the @MySQL@ command line
tool, or via @phpMyAdmin@.  This section will cover doing it with the
latter.

[procedure]
 - In @phpMyAdmin@, select the |Privileges| link from the front page,
   once you've logged in to it as *root*. 
 - The privileges section will present a *User Overview*, at the bottom
   of which there is a link to |Add a new user|.
 - In the *Add a new user* screen, fill out the details in the form as
   needed, making sure that the [label]|Host| field is set to *Any
   host*.
+
The privileges tick boxes lower down should be selected carefully.
Most applications will need at least those in the [label]|Data|
section, and some of those in the [label]|Structure| section.
Check the documentation of the software you're using to see what it
requires.
+
If you want an account with all privileges, select [label]|check
all|.

 - Once you're satisfied with everything, click |Go|.  This will
   confirm that a user has been created.
 - Now return to the home screen by clicking the @phpMyAdmin@ logo
   at the top left of the screen.
 - Finally, on the front page click the |Reload privileges| link to
   make sure @MySQL@ knows about this new user.

You should now be able to access the @MySQL@ database remotely, using
this new username and password.


