linux_wiki:network_services_overview_database_services

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:network_services_overview_database_services [2016/10/01 15:38]
billdozor [Use SELinux port labeling to allow services to use non-standard ports]
linux_wiki:network_services_overview_database_services [2019/05/25 23:50] (current)
Line 1: Line 1:
-====== Network Services Overview Database Services ======+====== Network Services OverviewDatabase Services ======
  
 **General Information** **General Information**
  
-This page covers the Network Services objectives, specifically for <service-name>+This page covers the Network Services objectives, specifically for MariaDB
  
 **Network Services Objectives** **Network Services Objectives**
Line 12: Line 12:
   * Configure the service for basic operation   * Configure the service for basic operation
   * Configure host-based and user-based security for the service   * Configure host-based and user-based security for the service
 +
 +----
 +
 +====== Lab Setup ======
 +
 +The following virtual machines will be used:
 +  * server1.example.com (192.168.1.150) -> Perform any client testing here
 +  * server2.example.com (192.168.1.151) -> Install the database here
  
 ---- ----
Line 19: Line 27:
 Install the service Install the service
 <code bash> <code bash>
-yum install <service-name>+yum install mariadb mariadb-server 
 +</code> 
 +  * mariadb -> the client 
 +  * mariadb-server -> the server 
 + 
 +\\ 
 +Documentation (what can go in the /etc/my.cnf config) 
 +<code bash> 
 +/usr/libexec/mysqld --verbose --help | less 
 + 
 +# then search for 'Variables' 
 +/Variables    <enter>
 </code> </code>
  
Line 35: Line 54:
  
   * Examples: "man semanage-port" has examples for allowing non-standard ports   * Examples: "man semanage-port" has examples for allowing non-standard ports
-  * Tip: To see current port labels<code bash>semanage port -l | grep mariadb</code>+  * Tip: To see current port labels<code bash>semanage port -l | grep mysql</code>
  
 \\ \\
Line 56: Line 75:
 SELinux: Allow mariadb to use the new port SELinux: Allow mariadb to use the new port
 <code bash> <code bash>
-semanage port -a -t mysqld_port_t 5502 -p tcp+semanage port -a -t mysqld_port_t -p tcp 5502
 </code> </code>
  
Line 64: Line 83:
 systemctl restart mariadb systemctl restart mariadb
 </code> </code>
 +
 +\\
 +Remote clients would need to connect like this example (specifying a port)<code bash>mysql -h 192.168.1.151 --port=5502 -u root -p</code>
 +  * -h 192.168.1.151  -> Remote hostname to connect to (can be an IP)
 +  * --port=5502  -> Use this remote port
 +  * -u root  -> Database username
 +  * -p  -> Prompt for password
  
 ---- ----
Line 71: Line 97:
 Check Current Service Status Check Current Service Status
 <code bash> <code bash>
-systemctl status <service-name>+systemctl status mariadb
 </code> </code>
   * Also displays if the service is enabled or disabled   * Also displays if the service is enabled or disabled
Line 78: Line 104:
 Enabling a service to start on boot Enabling a service to start on boot
 <code bash> <code bash>
-systemctl enable <service-name>+systemctl enable mariadb
 </code> </code>
  
Line 87: Line 113:
 Enable and Start the service Enable and Start the service
 <code bash> <code bash>
-systemctl enable <service-name> +systemctl enable mariadb 
-systemctl start <service-name>+systemctl start mariadb
 </code> </code>
  
Line 99: Line 125:
 Allow access through the firewall Allow access through the firewall
 <code bash> <code bash>
-firewall-cmd --permanent --add-service=<service-name>+firewall-cmd --permanent --add-service=mysql
 firewall-cmd --reload firewall-cmd --reload
 </code> </code>
  • linux_wiki/network_services_overview_database_services.1475350739.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)