Database Server Setup to allow connection from the instruments » History » Version 3
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 | For CentOS, Fedora |
||
| 21 | <pre> |
||
| 22 | sudo /etc/init.d/mysqld restart |
||
| 23 | </pre> |
||
| 24 | or |
||
| 25 | <pre> |
||
| 26 | sudo /sbin/service mysqld restart |
||
| 27 | </pre> |
||
| 28 | |||
| 29 | h3. 10 Create remote user |
||
| 30 | |||
| 31 | Create and grant privileges to the usr_object for the databases on the hosts involved. See MySQL Reference Manual for details. |
||
| 32 | |||
| 33 | 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. |
||
| 34 | If appropriate, you can also use domaian name with wild care i.e., '%.mydomain.edu' |
||
| 35 | |||
| 36 | At the mysql prompt execute the following commands: |
||
| 37 | <pre> |
||
| 38 | CREATE USER usr_object@'192.168.%.%' IDENTIFIED BY 'YOUR PASSWORD'; |
||
| 39 | GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'192.168.%.%'; |
||
| 40 | GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'192.168.%.%'; |
||
| 41 | </pre> |
||
| 42 | |||
| 43 | h3. Change localhost database user to usr_object if autoinstaller was used. |
||
| 44 | |||
| 45 | 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. |
||
| 46 | |||
| 47 | At the mysql prompt execute the following commands: |
||
| 48 | <pre> |
||
| 49 | CREATE USER usr_object@'localhost' IDENTIFIED BY 'YOUR PASSWORD'; |
||
| 50 | GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON leginondb.* TO usr_object@'localhost'; |
||
| 51 | GRANT ALTER, CREATE, INSERT, SELECT, UPDATE ON projectdb.* TO usr_object@'localhost'; |
||
| 52 | </pre> |
||
| 53 | |||
| 54 | ______ |
||
| 55 | |||
| 56 | [[Web Server Installation|< Web Server Installation]] | [[Additional Database Server Setup after Web Server Installation| Additional Database Server Setup >]] |
||
| 57 | |||
| 58 | |||
| 59 | ______ |