Chapter 11. Database configuration

Table of Contents

11.1. Adding a user with remote privileges

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.

In Symbiosis Stretch, MySQL uses unix socket auth for the root@localhost user by default, which is incompatible with phpMyAdmin. As such, a new admin@localhost user has been created to be used with phpMyAdmin. This user has privileges equivalent to root, but uses traditional username/password authentication instead.

11.1. Adding a user with remote privileges

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.

  1. In phpMyAdmin, select the Privileges link from the front page, once you’ve logged in to it as root (or admin on Symbiosis Stretch, as mentioned above).

  2. The privileges section will present a User Overview, at the bottom of which there is a link to Add a new user.

  3. In the Add a new user screen, fill out the details in the form as needed, making sure that the 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 Data section, and some of those in the 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 check all.

  4. Once you’re satisfied with everything, click Go. This will confirm that a user has been created.

  5. Now return to the home screen by clicking the phpMyAdmin logo at the top left of the screen.

  6. 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.