Database Server Setup to allow connection from the instruments » History » Version 4
Anchi Cheng, 01/06/2014 01:58 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 | 3 | Anchi Cheng | for example, 192.168.0.1 in a local network |
18 | 2 | Anchi Cheng | |
19 | h3. Restart mysqld |
||
20 | 4 | Anchi Cheng | |
21 | 2 | Anchi Cheng | 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 | </pre> |
||
29 | 1 | Anchi Cheng | |
30 | 4 | Anchi Cheng | h3. Create remote user |
31 | 2 | Anchi Cheng | |
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 | ______ |