Project

General

Profile

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

Anchi Cheng, 01/06/2014 01:28 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
h2. Bind mysqld to its IP address to allow tcp connection to it.
6
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
</pre>
12
Add the address the database is bound to after that line
13
<pre>
14
#skip-networking
15
bind-address=your.ip.address.number
16
</pre>
17
18
h3. Restart mysqld
19
For CentOS, Fedora
20
<pre>
21
sudo /etc/init.d/mysqld restart
22
</pre>
23
or
24
<pre>
25
sudo /sbin/service mysqld restart
26
</pre>
27
28
h3. 10 Create remote user
29
30
Create and grant privileges to the usr_object for the databases on the hosts involved.  See MySQL Reference Manual for details.
31
32
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.
33
If appropriate, you can also use domaian name with wild care i.e., '%.mydomain.edu'
34
35
At the mysql prompt execute the following commands:
36
<pre>
37
CREATE USER usr_object@'192.168.%.%' IDENTIFIED BY 'YOUR PASSWORD';
38
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'192.168.%.%';
39
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'192.168.%.%';
40
</pre>
41
42
h3. Change localhost database user to usr_object if autoinstaller was used.
43
44
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.
45
46
At the mysql prompt execute the following commands:
47
<pre>
48
CREATE USER usr_object@'localhost' IDENTIFIED BY 'YOUR PASSWORD';
49
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'localhost';
50
GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'localhost';
51
</pre>
52
53
______
54
55
[[Web Server Installation|< Web Server Installation]] | [[Additional Database Server Setup after Web Server Installation| Additional Database Server Setup >]] 
56
57
58
______