Project

General

Profile

Database Server Setup to allow connection from the instruments » History » Version 7

Anchi Cheng, 01/06/2014 02:13 PM

1 1 Anchi Cheng
h1. Database Server Setup to allow connection from the instruments
2
3 2 Anchi Cheng
You need to do is even if you have used autoinstaller  so that computers controlling the instruments (microscope/camera) can connect to the database
4
5 7 Anchi Cheng
h2. Allow remote access to database server.
6 2 Anchi Cheng
7
h3. Edit /etc/my.cnf search for *skip-networking* and make sure it is commented out like this:
8
9
<pre>
10
#skip-networking
11 1 Anchi Cheng
</pre>
12 7 Anchi Cheng
13
Also look for bind-address in the same file and if it says 127.0.0.1, it will only listen to local connection.
14
You should comment that out as well.
15 3 Anchi Cheng
<pre>
16 7 Anchi Cheng
#bind-address=127.0.0.1
17 5 Anchi Cheng
</pre>
18 2 Anchi Cheng
19 7 Anchi Cheng
h3. Restart mysqld if you have made changes.
20 2 Anchi Cheng
21
For CentOS, Fedora
22
<pre>
23
sudo /etc/init.d/mysqld restart
24
</pre>
25
or
26
<pre>
27
sudo /sbin/service mysqld restart
28 1 Anchi Cheng
</pre>
29 4 Anchi Cheng
30 2 Anchi Cheng
h3. Create remote user
31
32
Create and grant privileges to the usr_object for the databases on the hosts involved.  See MySQL Reference Manual for details.
33
34
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.
35
If appropriate, you can also use domaian name with wild care i.e., '%.mydomain.edu'
36
37
At the mysql prompt execute the following commands:
38
<pre>
39
CREATE USER usr_object@'192.168.%.%' IDENTIFIED BY 'YOUR PASSWORD';
40
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'192.168.%.%';
41
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'192.168.%.%';
42
</pre>
43
44
h3. Change localhost database user to usr_object if autoinstaller was used.
45
46
Autoinstaller does not create usr_object user on the localhost but use root user for database connection.   You may want to make change at this time.
47
48
At the mysql prompt execute the following commands:
49
<pre>
50
CREATE USER usr_object@'localhost' IDENTIFIED BY 'YOUR PASSWORD';
51
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'localhost';
52
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'localhost';
53
</pre>
54
55
______
56
57
[[Web Server Installation|< Web Server Installation]] | [[Additional Database Server Setup after Web Server Installation| Additional Database Server Setup >]] 
58
59
60 1 Anchi Cheng
______