Table of Contents
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.
As a security measure, your MySQL server is not opened to the world. However you might wish to access it remotely for performing queries, or allowing other hosts to otherwise communicate with it.
Your MySQL server should be configured already to listen upon your external IP addresses. Therefore only two steps are needed to configure remote access: opening the firewall, and adding a user with remote privileges to the database.
To open a hole in the firewall to the whole internet, you should
create the file /etc/symbiosis/firewall/incoming.d/55-mysql
. It is a good
idea to restrict access to the database to a list of known IP
addresses. To do this simply add IP addresses to the above file, one
per line.
Chapter 14, Firewall Reference gives full details of how the firewall works.
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.
In phpMyAdmin, select the link from the front page, once you’ve logged in to it as root — see Chapter 6, Managing the MySQL database for details on how to do this.
The privileges section will present a User Overview, at the bottom of which there is a link to .
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.
Once you’re satisfied with everything, click
. 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 MySQL knows about this new user.
link to make sureYou should now be able to access the MySQL database remotely, using this new username and password.