Project

General

Profile

Actions

Database Server Setup to allow connection from the instruments » History » Revision 8

« Previous | Revision 8/16 (diff) | Next »
Anchi Cheng, 01/06/2014 02:33 PM


Database Server Setup to allow connection from the instruments

You need to do is even if you have used autoinstaller so that computers controlling the instruments (microscope/camera) can connect to the database

Allow remote access to database server.

Edit /etc/my.cnf search for skip-networking and make sure it is commented out like this:

#skip-networking

Also look for bind-address in the same file and if it says 127.0.0.1, it will only listen to local connection.
You should comment that out as well.

#bind-address=127.0.0.1

Restart mysqld if you have made changes.

For CentOS, Fedora

sudo /etc/init.d/mysqld restart

or
sudo /sbin/service mysqld restart

Create remote user if autoinstaller was used

Autoinstaller creates only root user and only allow its access to database on the localhost.

The following assumes that you want to use usr_object user for remote access as referenced in most of this document.

Create and grant privileges to the usr_object for the databases on the hosts involved. See MySQL Reference Manual for details.

You can set hosts on a particular subnet by only specify the network number portion such as '192.168' and use wild card for the host number portion to give '192.168.%.%' as the global host allowing connection.
If appropriate, you can also use domain name with wild care i.e., '%.mydomain.edu'

At the mysql prompt execute the following commands:

CREATE USER usr_object@'192.168.%.%' IDENTIFIED BY 'YOUR PASSWORD';
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'192.168.%.%';
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'192.168.%.%';

CREATE USER usr_object@'localhost' IDENTIFIED BY 'YOUR PASSWORD';
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'localhost';
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'localhost';

other server changes if usr_object will be used all the time from now on in autoinstalled Leginon:

webserver myamiweb/config.php

define('DB_USER', 'usr_object');
defube('DB_USER','');

processing server /etc/myami/sinedon.cfg or ,if it does not exist, /tmp/myami/sinedon/sinedon.cfg

user: usr_object
passwd:


< Web Server Installation | Additional Database Server Setup >


Updated by Anchi Cheng almost 11 years ago · 8 revisions