<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/tag/mysql/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Fri, 28 Mar 2025 00:37:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>MySQL Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/tag/mysql/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Optimizing MySQL Performance on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/optimizing-mysql-performance-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 00:37:15 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12157</guid>

					<description><![CDATA[<p>Introduction This guide provides comprehensive steps to optimize MySQL performance on a ServerStadium dedicated server. By fine-tuning your MySQL configuration, you can enhance database speed, improve resource utilization, and ensure scalability for high-traffic web applications. Prerequisites Before proceeding, ensure you have the following: Optimization Steps 1. Update Your System and MySQL Ensure that your system&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/optimizing-mysql-performance-dedicated-servers/">Optimizing MySQL Performance on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This guide provides comprehensive steps to optimize MySQL performance on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. By fine-tuning your MySQL configuration, you can enhance database speed, improve resource utilization, and ensure scalability for high-traffic web applications.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before proceeding, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu (or a similar Linux distribution) with MySQL installed.</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>Familiarity with MySQL configuration and performance tuning concepts.</li>
  
</ul>



<h2 class="wp-block-heading">Optimization Steps</h2>



<h3 class="wp-block-heading">1. Update Your System and MySQL</h3>



<p class="wp-block-paragraph">Ensure that your system and MySQL packages are up-to-date:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install mysql-server -y</code></pre>


<h3 class="wp-block-heading">2. Backup Current MySQL Configuration</h3>



<p class="wp-block-paragraph">Before making any changes, backup your existing MySQL configuration file:</p>


<pre><code>sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.backup</code></pre>


<h3 class="wp-block-heading">3. Optimize MySQL Configuration</h3>



<p class="wp-block-paragraph">Edit the MySQL configuration file to adjust key parameters. Open the configuration file with your preferred text editor:</p>


<pre><code>sudo nano /etc/mysql/my.cnf</code></pre>


<p class="wp-block-paragraph">Some important settings to consider include:</p>


<ul class="wp-block-list">
  
  <li><strong>innodb_buffer_pool_size</strong>: Allocate 60-80% of available RAM if MySQL is the primary service.</li>
  
  
  <li><strong>query_cache_size</strong>: Disable or set to a low value if using InnoDB.</li>
  
  
  <li><strong>max_connections</strong>: Adjust based on your workload.</li>
  
  
  <li><strong>tmp_table_size</strong> and <strong>max_heap_table_size</strong>: Increase these values to improve temporary table performance.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>After making changes, save the file and exit the editor.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3,"className":""} -->
<h3 class="wp-block-heading">4. Restart MySQL Service</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Apply the configuration changes by restarting MySQL:</p>
<!-- /wp:paragraph -->

<pre><code>sudo systemctl restart mysql</code></pre>

<!-- wp:heading {"level":3,"className":""} -->
<h3 class="wp-block-heading">5. Monitor Performance</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Use MySQL performance monitoring tools to review the impact of your changes. Commands like the following can be helpful:</p>
<!-- /wp:paragraph -->

<pre><code>mysqladmin -u root -p extended-status
mysql -u root -p -e "SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool%';"</code></pre>

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Post-Deployment Configuration</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Consider these additional steps to further optimize MySQL performance:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Regularly analyze slow query logs to identify and optimize inefficient queries.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Use MySQL tuning scripts or tools (e.g., MySQLTuner) for periodic performance assessments.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Monitor system resources using tools like <code>htop</code> or <code>vmstat</code> to ensure MySQL is not overloading the server.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your MySQL database on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures that you have the high-performance, scalable infrastructure needed to support demanding applications.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues or performance bottlenecks:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Review MySQL error logs located in <code>/var/log/mysql/</code> for any warnings or errors.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Revisit your MySQL configuration and adjust parameters based on observed performance.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult MySQL documentation and use performance tuning tools to further optimize your setup.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Refer to our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for additional support.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Optimizing MySQL performance on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> enables you to handle high traffic and large datasets efficiently. By following this guide and continuously monitoring performance, you can ensure that your database operates at peak efficiency. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/optimizing-mysql-performance-dedicated-servers/">Optimizing MySQL Performance on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 00:24:04 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12153</guid>

					<description><![CDATA[<p>Introduction This guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a ServerStadium dedicated server. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability. Prerequisites Before you begin, ensure you have the following: Deployment Steps 1.&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This guide provides step-by-step instructions to deploy a LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04 using a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. A LEMP stack is an ideal solution for hosting dynamic websites and web applications, delivering high performance and scalability.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu 22.04.</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>An understanding of web server concepts.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">First, update your system to ensure all packages are current:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install Nginx</h3>



<p class="wp-block-paragraph">Install the Nginx web server:</p>


<pre><code>sudo apt-get install nginx -y</code></pre>


<p class="wp-block-paragraph">After installation, start and enable Nginx:</p>


<pre><code>sudo systemctl start nginx
sudo systemctl enable nginx</code></pre>


<h3 class="wp-block-heading">3. Install MySQL</h3>



<p class="wp-block-paragraph">Install MySQL server for database management:</p>


<pre><code>sudo apt-get install mysql-server -y</code></pre>


<p class="wp-block-paragraph">Secure your MySQL installation:</p>


<pre><code>sudo mysql_secure_installation</code></pre>


<h3 class="wp-block-heading">4. Install PHP</h3>



<p class="wp-block-paragraph">Install PHP and the necessary modules to work with Nginx and MySQL:</p>


<pre><code>sudo apt-get install php-fpm php-mysql -y</code></pre>


<p class="wp-block-paragraph">Verify that PHP is installed by checking the version:</p>


<pre><code>php -v</code></pre>


<h3 class="wp-block-heading">5. Configure Nginx to Use PHP Processor</h3>



<p class="wp-block-paragraph">Edit the default Nginx server block to enable PHP processing. Open the configuration file:</p>


<pre><code>sudo nano /etc/nginx/sites-available/default</code></pre>


<p class="wp-block-paragraph">Modify the file to include the following configuration within the server block. Ensure the location for PHP files is set as shown:</p>


<pre><code>server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}</code></pre>


<p class="wp-block-paragraph">Save and exit the editor, then test the Nginx configuration for syntax errors:</p>


<pre><code>sudo nginx -t</code></pre>


<p class="wp-block-paragraph">If the test is successful, reload Nginx:</p>


<pre><code>sudo systemctl reload nginx</code></pre>


<h3 class="wp-block-heading">6. Verify Your LEMP Stack Installation</h3>



<p class="wp-block-paragraph">Create a PHP info file to confirm that PHP is processing correctly:</p>


<pre><code>sudo nano /var/www/html/info.php</code></pre>


<p class="wp-block-paragraph">Add the following content to the file:</p>


<pre><code>&lt;?php
phpinfo();
?&gt;</code></pre>


<p class="wp-block-paragraph">Save and exit, then open a web browser and navigate to <code>http://your_server_ip/info.php</code> to view the PHP info page.</p>



<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After deploying the LEMP stack, consider the following enhancements:</p>


<ul class="wp-block-list">
  
  <li>Secure your server by configuring UFW or another firewall to limit access.</li>
  
  
  <li>Optimize PHP and Nginx settings based on your application requirements.</li>
  
  
  <li>Set up regular backups and monitor server performance.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your LEMP stack on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures you benefit from a high-performance, scalable environment for running your web applications.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during installation or configuration:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Ensure all prerequisites are installed and updated.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Review configuration files for Nginx, PHP, and MySQL for any errors.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the logs in <code>/var/log/nginx/</code>, <code>/var/log/mysql/</code>, and <code>/var/log/php/</code> for troubleshooting details.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Refer to our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for additional support.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Deploying a LEMP stack on Ubuntu 22.04 on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides a robust foundation for hosting dynamic websites and applications. By following this guide, you ensure that your server is optimized for performance and security. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/deploying-lemp-stack-ubuntu2204-dedicated-servers/">Deploying a LEMP Stack on Ubuntu 22.04 on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Advanced Database Clustering with Galera Cluster for MySQL</title>
		<link>https://serverstadium.com/knowledge-base/advanced-database-clustering-with-galera-cluster-for-mysql/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 23:49:33 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11863</guid>

					<description><![CDATA[<p>Introduction Implementing Galera Cluster for MySQL on ServerStadium’s infrastructure (VM Pricing, Dedicated Servers) enables businesses to manage large-scale, high-availability databases efficiently. Galera Cluster&#8217;s synchronous replication model ensures that data is consistent across all nodes, making it ideal for critical applications requiring high uptime and data integrity. Prerequisites ServerStadium VMs or dedicated servers (VM Pricing, Dedicated&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/advanced-database-clustering-with-galera-cluster-for-mysql/">Advanced Database Clustering with Galera Cluster for MySQL</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Implementing Galera Cluster for MySQL on ServerStadium’s infrastructure (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>) enables businesses to manage large-scale, high-availability databases efficiently. Galera Cluster&#8217;s synchronous replication model ensures that data is consistent across all nodes, making it ideal for critical applications requiring high uptime and data integrity.</p>
<h3>Prerequisites</h3>
<ul>
<li>ServerStadium VMs or dedicated servers (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>)., ideally three for a basic cluster setup.</li>
<li>Basic knowledge of MySQL database administration.</li>
<li>SSH access to the servers.</li>
</ul>
<h3>Step 1: Set Up ServerStadium Environment</h3>
<ol>
<li><strong>Choose Servers</strong>: Select three or more ServerStadium servers to form a cluster.</li>
<li><strong>Prepare Servers</strong>:
<p><div class="shortcode-code">
<p> sudo apt update<br />
sudo apt upgrade </p></div></li>
</ol>
<h3>Step 2: Install MySQL and Galera on Each Node</h3>
<ol>
<li><strong>Install MySQL</strong>:
<p>Install MySQL on each server:</p>
<p><div class="shortcode-code">
<p> sudo apt install mysql-server </p></div></li>
<li><strong>Install Galera</strong>:
<p>Install the Galera package:</p>
<p><div class="shortcode-code">
<p> sudo apt install galera-4 </p></div></li>
</ol>
<h3>Step 3: Configure MySQL for Galera Cluster</h3>
<ol>
<li><strong>Configure MySQL on Each Node</strong>:
<p>Edit the MySQL configuration file (<code>/etc/mysql/my.cnf</code> or similar) to enable Galera:</p>
<p><div class="shortcode-code">
<p> sudo nano /etc/mysql/my.cnf </p></div></p>
<p>Add the following under the <code>[mysqld]</code> section:<br />
<div class="shortcode-code">
<p>&#091;mysqld&#093;<br />
wsrep_provider=/usr/lib/galera/libgalera_smm.so<br />
wsrep_cluster_name=&#039;galera_cluster&#039;<br />
wsrep_cluster_address=&#039;gcomm://node1_ip,node2_ip,node3_ip&#039;<br />
wsrep_node_address=&#039;this_node_ip&#039;<br />
wsrep_sst_method=rsync</p></div><br />
Replace <code>node1_ip</code>, <code>node2_ip</code>, <code>node3_ip</code>, and <code>this_node_ip</code> with the actual IP addresses of your nodes.</li>
</ol>
<h3>Step 4: Initialize the Galera Cluster</h3>
<ol>
<li><strong>Start the First Node</strong>:
<p>On the first node, start the MySQL server with Galera initialization:</p>
<p><div class="shortcode-code">
<p> sudo galera_new_cluster </p></div></li>
<li><strong>Start MySQL on Other Nodes</strong>:
<p>On the remaining nodes, start the MySQL service normally:</p>
<p><div class="shortcode-code">
<p> sudo systemctl start mysql </p></div></li>
</ol>
<h3>Step 5: Verify Cluster Operation</h3>
<ol>
<li><strong>Check Cluster Size</strong>:
<p>Verify that the cluster is operational by checking the cluster size on any node:</p>
<p><div class="shortcode-code">
<p> mysql -u root -p -e &quot;SHOW STATUS LIKE &#039;wsrep_cluster_size&#039;&quot; </p></div></li>
</ol>
<h3>Conclusion</h3>
<p>Galera Cluster enhances MySQL&#8217;s capabilities on ServerStadium servers, providing a robust platform for high-availability database solutions. It&#8217;s an ideal setup for applications demanding high data integrity and minimal downtime. For advanced cluster configurations and management, visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or contact our <a href="https://serverstadium.com/" target="_new" rel="noopener">support team</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/advanced-database-clustering-with-galera-cluster-for-mysql/">Advanced Database Clustering with Galera Cluster for MySQL</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating a New User and Granting Permissions in MySQL on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/creating-a-new-user-and-granting-permissions-in-mysql-on-serverstadium/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 06:06:11 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11830</guid>

					<description><![CDATA[<p>Introduction Managing user access and permissions is a critical aspect of database administration in MySQL. Whether you&#8217;re running a MySQL server on a ServerStadium VM or dedicated server, it&#8217;s essential to understand how to create new users and define their privileges securely. Creating a New User and Granting Permissions in MySQL on ServerStadium Prerequisites A&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/creating-a-new-user-and-granting-permissions-in-mysql-on-serverstadium/">Creating a New User and Granting Permissions in MySQL on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Managing user access and permissions is a critical aspect of database administration in MySQL. Whether you&#8217;re running a MySQL server on a ServerStadium VM or dedicated server, it&#8217;s essential to understand how to create new users and define their privileges securely.</p>
<h2>Creating a New User and Granting Permissions in MySQL on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server running MySQL. Explore ServerStadium&#8217;s offerings at <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a> and <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>.</li>
<li>Access to the MySQL server as a user with administrative privileges.</li>
</ul>
<h3>Step 1: Access the MySQL Server</h3>
<ol>
<li><strong>Log in to MySQL</strong>:
<p><div class="shortcode-code">
<p> mysql -u root -p </p></div></p>
<p>Enter the root password when prompted.</li>
</ol>
<h3>Step 2: Create a New User</h3>
<ol>
<li><strong>Create a New User</strong>:
<p>Execute the following command in MySQL, replacing <code>'newuser'</code> and <code>'password'</code> with your chosen username and password.</p>
<p><div class="shortcode-code">
<p> CREATE USER &#039;newuser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;password&#039;; </p></div></p>
<p>This command creates a new user who can connect to the MySQL server from the localhost.</li>
</ol>
<h3>Step 3: Grant Permissions to the User</h3>
<ol>
<li><strong>Grant Permissions</strong>:
<p>After creating the new user, you need to grant them specific privileges based on their role.</p>
<p>To grant all privileges to the user on all databases:</p>
<p><div class="shortcode-code">
<p> GRANT ALL PRIVILEGES ON &lt;em&gt;.&lt;/em&gt; TO &#039;newuser&#039;@&#039;localhost&#039;; </p></div></p>
<p>For specific privileges:</p>
<p><div class="shortcode-code">
<p> GRANT SELECT, INSERT ON &lt;code&gt;mydb&lt;/code&gt;.* TO &#039;newuser&#039;@&#039;localhost&#039;; </p></div></p>
<p>Replace <code>mydb</code> with the name of your database and adjust the privileges (<code>SELECT</code>, <code>INSERT</code>, etc.) as needed.</li>
<li><strong>Apply the Privileges</strong>:
<p>After granting the privileges, you need to flush the privileges to apply the changes:</p>
<p><div class="shortcode-code">
<p> FLUSH PRIVILEGES; </p></div></li>
</ol>
<h3>Conclusion</h3>
<p>Your new MySQL user is now set up with the specified privileges on your ServerStadium server. Managing MySQL users and their permissions is crucial for maintaining the security and integrity of your databases. For more information on server and database management, visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or contact our support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/creating-a-new-user-and-granting-permissions-in-mysql-on-serverstadium/">Creating a New User and Granting Permissions in MySQL on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Up phpMyAdmin on ServerStadium for Database Management</title>
		<link>https://serverstadium.com/knowledge-base/setting-up-phpmyadmin-on-serverstadium-for-database-management/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 05:16:55 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11816</guid>

					<description><![CDATA[<p>Introduction phpMyAdmin provides a convenient and intuitive web interface for managing MySQL and MariaDB databases, ideal for those who prefer a graphical interface over command-line operations. Hosting phpMyAdmin on ServerStadium&#8217;s robust infrastructure (VM Pricing, Dedicated Servers) enhances your database management capabilities, allowing you to efficiently administer your databases directly through your web browser. Setting Up&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-phpmyadmin-on-serverstadium-for-database-management/">Setting Up phpMyAdmin on ServerStadium for Database Management</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>phpMyAdmin provides a convenient and intuitive web interface for managing MySQL and MariaDB databases, ideal for those who prefer a graphical interface over command-line operations. Hosting phpMyAdmin on ServerStadium&#8217;s robust infrastructure (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>) enhances your database management capabilities, allowing you to efficiently administer your databases directly through your web browser.</p>
<h2>Setting Up phpMyAdmin on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>).</li>
<li>MySQL or MariaDB installed on the server.</li>
<li>Basic knowledge of web server administration.</li>
</ul>
<h3>Step 1: Select and Prepare Your ServerStadium Server</h3>
<ol>
<li><strong>Choose a Server</strong>: Opt for a ServerStadium server that aligns with your database management needs.</li>
<li><strong>Server Setup</strong>: Connect to your server via SSH and update the system:
<p><div class="shortcode-code">
<p> sudo apt update<br />
sudo apt upgrade </p></div></li>
</ol>
<h3>Step 2: Install LAMP Stack (If Not Already Installed)</h3>
<p>If you haven&#8217;t already installed a LAMP stack:</p>
<ol>
<li><strong>Install Apache</strong>:
<p><div class="shortcode-code">
<p> sudo apt install apache2 </p></div></li>
<li><strong>Install MySQL/MariaDB</strong>:
<p><div class="shortcode-code">
<p> sudo apt install mariadb-server<br />
sudo mysql_secure_installation </p></div></li>
<li><strong>Install PHP</strong>:
<p><div class="shortcode-code">
<p> sudo apt install php php-mbstring php-zip php-gd php-json php-curl </p></div></li>
</ol>
<h3>Step 3: Install and Configure phpMyAdmin</h3>
<ol>
<li><strong>Install phpMyAdmin</strong>:
<p><div class="shortcode-code">
<p> sudo apt install phpmyadmin </p></div></p>
<p>Follow the prompts to complete the installation. Choose Apache as the web server and configure the database settings for phpMyAdmin.</li>
<li><strong>Enable phpMyAdmin Configuration in Apache</strong>:
<p><div class="shortcode-code">
<p> sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf sudo a2enconf phpmyadmin<br />
sudo systemctl restart apache2 </p></div></li>
</ol>
<h3>Step 4: Accessing phpMyAdmin</h3>
<ol>
<li><strong>Access phpMyAdmin</strong>:
<p>Navigate to <code>http://your_server_ip/phpmyadmin</code> in your web browser.</li>
<li><strong>Log in to phpMyAdmin</strong>:
<p>Use your MySQL/MariaDB credentials to log in to phpMyAdmin.</li>
</ol>
<h3>Step 5: Manage Databases with phpMyAdmin</h3>
<ol>
<li><strong>Perform Database Operations</strong>:
<p>Use phpMyAdmin’s web interface to manage databases, execute SQL queries, import/export data, and perform various database administration tasks.</li>
</ol>
<h3>Conclusion</h3>
<p>Your phpMyAdmin setup on a ServerStadium server is now complete, offering an efficient and user-friendly platform for managing MySQL or MariaDB databases. For further assistance or resources, visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">knowledge base</a> or contact our support team.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/setting-up-phpmyadmin-on-serverstadium-for-database-management/">Setting Up phpMyAdmin on ServerStadium for Database Management</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Database Optimization on ServerStadium Servers</title>
		<link>https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 04:16:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11787</guid>

					<description><![CDATA[<p>Introduction Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On ServerStadium servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure. Database Optimization on ServerStadium&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On <a href="http://Https://ServerStadium">ServerStadium</a> servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure.</p>
<h2>Database Optimization on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>).</li>
<li>Basic knowledge of Linux and command-line interface.</li>
</ul>
<h3>General Optimization Tips</h3>
<p>Before diving into specific databases, here are some general optimization strategies:</p>
<ol>
<li><strong>Regular Maintenance</strong>: Regularly update and maintain your database software to the latest stable version.</li>
<li><strong>Monitor Performance</strong>: Utilize monitoring tools to track database performance and identify bottlenecks.</li>
<li><strong>Backup and Disaster Recovery</strong>: Regularly backup your databases and have a disaster recovery plan in place.</li>
</ol>
<h3>Optimizing MySQL on ServerStadium</h3>
<ol>
<li><strong>Tune Key Parameters</strong>: Adjust key settings in <code>my.cnf</code> like <code>innodb_buffer_pool_size</code>, <code>max_connections</code>, and <code>query_cache_size</code> based on your server&#8217;s resources and workload.</li>
<li><strong>Indexing</strong>: Properly index your tables to speed up query execution.</li>
<li><strong>Use EXPLAIN</strong>: Regularly use the <code>EXPLAIN</code> statement to analyze and optimize your SQL queries.</li>
<li><strong>Partitioning</strong>: Consider partitioning large tables to improve performance and management.</li>
</ol>
<h3>Optimizing PostgreSQL on ServerStadium</h3>
<ol>
<li><strong>Configuration Tuning</strong>: In <code>postgresql.conf</code>, tune parameters like <code>shared_buffers</code>, <code>work_mem</code>, <code>maintenance_work_mem</code>, and <code>effective_cache_size</code>.</li>
<li><strong>Vacuum and Analyze</strong>: Regularly run the <code>VACUUM</code> and <code>ANALYZE</code> commands to maintain database health.</li>
<li><strong>Index Maintenance</strong>: Use appropriate indexing strategies (B-tree, hash, GIN, etc.) for your queries and regularly monitor their performance.</li>
<li><strong>Connection Pooling</strong>: Use connection pooling to manage a large number of client connections efficiently.</li>
</ol>
<h3>Optimizing MongoDB on ServerStadium</h3>
<ol>
<li><strong>Sharding</strong>: Implement sharding to distribute data across multiple machines.</li>
<li><strong>Indexing</strong>: Proper indexing is crucial in MongoDB for query performance. Regularly review and optimize your indexes.</li>
<li><strong>Replication</strong>: Set up replication for data redundancy and high availability.</li>
<li><strong>Resource Allocation</strong>: Ensure that MongoDB has sufficient RAM and is configured to effectively use the available memory.</li>
</ol>
<h3>Conclusion</h3>
<p>Optimizing your database on ServerStadium servers can lead to significant performance improvements. By following these tips and regularly monitoring your database, you can ensure efficient, fast, and reliable data access.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to install and secure MariaDB on Ubuntu 18.04 and 20.04 on ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/how-to-install-and-secure-mariadb-on-ubuntu-18-04-and-20-04/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 22 Mar 2021 05:43:31 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=937</guid>

					<description><![CDATA[<p>In this article, we are going to show you how to install and secure MariaDB on Ubuntu 18.04 and 20.04 on ServerStadium, after previously talking about MongoDB. Read also: How to Install and Secure MongoDB on Ubuntu 18.04 and 20.04 But, before that, let&#8217;s define what MariaDB is. In short, MariaDB is an open-source, community-developed,&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-install-and-secure-mariadb-on-ubuntu-18-04-and-20-04/">How to install and secure MariaDB on Ubuntu 18.04 and 20.04 on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this article, we are going to show you how to install and secure MariaDB on Ubuntu 18.04 and 20.04 on ServerStadium, after previously talking about MongoDB.</p>



<p class="wp-block-paragraph">Read also: <a href="https://serverstadium.com/knowledge-base/how-to-install-and-securing-mongodb-on-ubuntu-18-04-and-20-04/" target="_blank" rel="noreferrer noopener">How to Install and Secure MongoDB on Ubuntu 18.04 and 20.04</a></p>



<p class="wp-block-paragraph">But, before that, let&#8217;s define what MariaDB is. In short, MariaDB is an open-source, community-developed, forever free relational database management system (RDBMS) forked from MySQL. However, it is highly compatible with MySQL as a drop-in replacement.</p>



<p class="wp-block-paragraph">So, check the steps below to install and secure <strong>MariaDB 10.5</strong> for <strong>Ubuntu 18.04</strong> and <strong>Ubuntu 20.04</strong> instances on ServerStadium.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">TLDR</h2>



<p class="wp-block-paragraph">For those who need quick steps:</p>



<ol class="wp-block-list">
<li>Firstly, Enter the commands below</li>
<li>Secondly, allow remote connections to port 3306/TCP on the Security Profile.</li>
</ol>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<pre class="wp-block-code"><code>&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install apt-transport-https -y
curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo apt install mariadb-server -y
sudo mysql_secure_installation
# For remote connection, otherwise ignore these lines
sudo sed -Ei 's/(bind-address *=).*/\1 INTERFACE-IP/' /etc/mysql/mariadb.conf.d/50-server.cnf
sudo systemctl restart mariadb
sudo ufw allow 3306/tcp&lt;/code&gt;</code></pre>
</div></div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">How to Install MariaDB</h2>



<p class="wp-block-paragraph">MariaDB hasn&#8217;t been shipped to Ubuntu 18.04 / 20.04 official repository yet. So you will have to download it directly from <a href="https://mariadb.com">https://mariadb.com</a>. After that, you can either do the following:</p>



<ol class="wp-block-list">
<li>Download the binary packages, or</li>
<li>Setup the repository via script</li>
</ol>



<p class="wp-block-paragraph">Hence, this tutorial will cover the second method.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 1. Install apt-transport-https</h3>



<p class="wp-block-paragraph">Firstly, the installer script needs <code>apt-transport-https</code> package.</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt install apt-transport-https -y</code></pre>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 2. Pull the script and execute</h3>



<p class="wp-block-paragraph">You can download the script on</p>



<pre class="wp-block-preformatted"><code>https://downloads.mariadb.com/MariaDB/mariadb_repo_setup</code></pre>



<p class="wp-block-paragraph">and run it, but you can do it in one-liner like this instead:</p>



<pre class="wp-block-code"><code>curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>A brief explanation about the <code>-LsS</code> flags on <code>curl </code>command: <br />&#8211; <code>L</code> Curl will follow any redirects <br />&#8211; <code>s</code> Silent all outputs <br />&#8211; <code>S</code> If used together with <code>s</code>, it will output error messages <em>only</em> on failure</p>
</blockquote>



<figure class="wp-block-image size-large is-resized"><img fetchpriority="high" decoding="async" class="wp-image-938" src="https://serverstadium.com/wp-content/uploads/2021/01/image-43.png" alt="" width="679" height="195" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-43.png 2048w, https://serverstadium.com/wp-content/uploads/2021/01/image-43-300x86.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-43-1024x294.png 1024w, https://serverstadium.com/wp-content/uploads/2021/01/image-43-768x221.png 768w, https://serverstadium.com/wp-content/uploads/2021/01/image-43-1536x441.png 1536w" sizes="(max-width: 679px) 100vw, 679px" />
<figcaption>MariaDB repo setup script</figcaption>
</figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 3. Install mariadb-server</h3>



<p class="wp-block-paragraph">You don&#8217;t have to update the repository, as the script has done it for you. So, proceed to install:</p>



<pre class="wp-block-code"><code>sudo apt install mariadb-server -y</code></pre>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Configuration</h2>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 4. Secure the installation</h3>



<p class="wp-block-paragraph">To secure the MariaDB installation, run:</p>



<pre class="wp-block-code"><code>sudo mysql_secure_installation</code></pre>



<p class="wp-block-paragraph">Then, answer every prompt with yes.</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" class="wp-image-939" src="https://serverstadium.com/wp-content/uploads/2021/01/image-44.png" alt="" width="782" height="1446" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-44.png 1564w, https://serverstadium.com/wp-content/uploads/2021/01/image-44-162x300.png 162w, https://serverstadium.com/wp-content/uploads/2021/01/image-44-554x1024.png 554w, https://serverstadium.com/wp-content/uploads/2021/01/image-44-768x1420.png 768w, https://serverstadium.com/wp-content/uploads/2021/01/image-44-831x1536.png 831w, https://serverstadium.com/wp-content/uploads/2021/01/image-44-1108x2048.png 1108w" sizes="(max-width: 782px) 100vw, 782px" />
<figcaption>Securing MariaDB installation</figcaption>
</figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 5. Enable remote access</h3>



<p class="wp-block-paragraph">The default setting for a fresh MariaDB installation is to allow only local connections. So, you can verify it via the below syntax:</p>



<pre class="wp-block-code"><code>sudo ss -tulpn | grep mariadb</code></pre>



<figure class="wp-block-image size-large is-resized"><img decoding="async" class="wp-image-940" src="https://serverstadium.com/wp-content/uploads/2021/01/image-45.png" alt="" width="768" height="180" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-45.png 1024w, https://serverstadium.com/wp-content/uploads/2021/01/image-45-300x70.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-45-768x180.png 768w" sizes="(max-width: 768px) 100vw, 768px" />
<figcaption>MariaDB is listening on 127.0.0.1</figcaption>
</figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><code>ss -tulpn</code> will list all listening ports/sockets. <br />&#8211; <code>t</code> Display TCP sockets.<br />&#8211; <code>u</code> Display UDP sockets. <br />&#8211; <code>l</code> Display only listening sockets. <br />&#8211; <code>p</code> Show process using socket. <br />&#8211; <code>n</code> Do not try to resolve service names.</p>
</blockquote>



<p class="wp-block-paragraph">There, you will see that it listens to loopback IP (127.0.0.1), which means it will not accept remote connections.</p>



<p class="wp-block-paragraph">If you plan to build an app on the same server, then this is enough, and you can ignore the rest of the steps. But, if this is not the case, you can keep going.</p>



<p class="wp-block-paragraph">Then, Open <code>/etc/mysql/mariadb.conf.d/50-server.conf</code> and find the line <code>bind-address</code>. After that, change the IP address  <code>127.0.0.1</code> to your interface IP.</p>



<pre class="wp-block-code"><code>sudoedit /etc/mysql/mariadb.conf.d/50-server.conf
# find line 'bind-address = 127.0.0.1'
# change it to interface's IP</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="900" height="276" class="wp-image-941" src="https://serverstadium.com/wp-content/uploads/2021/01/image-46.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-46.png 900w, https://serverstadium.com/wp-content/uploads/2021/01/image-46-300x92.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-46-768x236.png 768w" sizes="(max-width: 900px) 100vw, 900px" />
<figcaption>Change bind-address</figcaption>
</figure>



<p class="wp-block-paragraph">If you are not sure which IP to set, then you can check it by using the below command:</p>



<pre class="wp-block-code"><code>ip -4 -br a s</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="801" height="240" class="wp-image-942" src="https://serverstadium.com/wp-content/uploads/2021/01/image-47.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-47.png 801w, https://serverstadium.com/wp-content/uploads/2021/01/image-47-300x90.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-47-768x230.png 768w" sizes="(max-width: 801px) 100vw, 801px" />
<figcaption>Display IP addresses</figcaption>
</figure>



<p class="wp-block-paragraph">After you have changed the bind-address, you need to restart the MariaDB service.</p>



<pre class="wp-block-code"><code>sudo systemctl restart mariadb
# check the status
sudo systemctl status mariadb</code></pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" class="wp-image-943" src="https://serverstadium.com/wp-content/uploads/2021/01/image-48.png" alt="" width="768" height="461" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-48.png 1024w, https://serverstadium.com/wp-content/uploads/2021/01/image-48-300x180.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-48-768x461.png 768w" sizes="(max-width: 768px) 100vw, 768px" />
<figcaption>MariaDB service status</figcaption>
</figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 6. Allow port 3306/TCP on ufw</h3>



<p class="wp-block-paragraph">By default, both Ubuntu 18.04 and Ubuntu 20.04 are using <code>ufw</code>. But first, check if it&#8217;s active or not:</p>



<pre class="wp-block-code"><code>sudo ufw status</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="822" height="298" class="wp-image-944" src="https://serverstadium.com/wp-content/uploads/2021/01/image-49.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-49.png 822w, https://serverstadium.com/wp-content/uploads/2021/01/image-49-300x109.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-49-768x278.png 768w" sizes="(max-width: 822px) 100vw, 822px" />
<figcaption>Display UFW status</figcaption>
</figure>



<p class="wp-block-paragraph">If it&#8217;s inactive, then skip this step. Otherwise, you need to allow mariadb (3306/tcp).</p>



<pre class="wp-block-code"><code>sudo ufw allow 3306/tcp
# or
sudo ufw allow mysql</code></pre>



<p class="wp-block-paragraph">Then, verify by using <code>sudo ufw status</code></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="850" height="378" class="wp-image-945" src="https://serverstadium.com/wp-content/uploads/2021/01/image-50.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-50.png 850w, https://serverstadium.com/wp-content/uploads/2021/01/image-50-300x133.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-50-768x342.png 768w" sizes="(max-width: 850px) 100vw, 850px" /></figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step 7. Add Firewall Rule on the Security Profile on ServerStadium</h3>



<p class="wp-block-paragraph">Add TCP port 3306 (MySQL default port) to the Security Profile to allow remote public connections.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="826" height="346" class="wp-image-946" src="https://serverstadium.com/wp-content/uploads/2021/01/image-51.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2021/01/image-51.png 826w, https://serverstadium.com/wp-content/uploads/2021/01/image-51-300x126.png 300w, https://serverstadium.com/wp-content/uploads/2021/01/image-51-768x322.png 768w" sizes="(max-width: 826px) 100vw, 826px" />
<figcaption>Add Firewall Rule on the Security Profile</figcaption>
</figure>



<p class="wp-block-paragraph">All in all, that is how you install and secure MariaDB on Ubuntu 18.04 and 20.04. If you are eager for more information, you should check our previous article about installing and securing<a href="https://serverstadium.com/knowledge-base/how-to-install-and-securing-mongodb-on-ubuntu-18-04-and-20-04/" target="_blank" rel="noreferrer noopener"> MongoDB on Ubuntu</a>.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-install-and-secure-mariadb-on-ubuntu-18-04-and-20-04/">How to install and secure MariaDB on Ubuntu 18.04 and 20.04 on ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Installing LAMP in Ubuntu</title>
		<link>https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 15 Sep 2020 07:14:56 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=188</guid>

					<description><![CDATA[<p>LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP. To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">LAMP (Linux, Apache, MySQL, PHP) is a software stack that is quite popular for Ubuntu users to host dynamic websites and web applications written in PHP.</p>



<p class="wp-block-paragraph">To use LAMP properly, we must install Apache, MySQL, and PHP packages individually. Here are the steps for installing and configuring LAMP in the ServerStadium Virtual Machine that uses the Ubuntu operating system.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 1 &#8211; Installing Apache2</strong></h2>



<p class="wp-block-paragraph">Apache2 is the most famous web server with the most users worldwide. Therefore, it still is a great choice for hosting a website.<br />To begin with, update the Ubuntu repository with the command :</p>



<pre class="wp-block-code"><code># apt update</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="313" height="20" class="wp-image-196" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2.png 313w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-300x19.png 300w" sizes="(max-width: 313px) 100vw, 313px" /></figure>



<p class="wp-block-paragraph">Then, install the Apache2 package with the command :</p>



<pre class="wp-block-code"><code># apt install apache2</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="489" height="21" class="wp-image-197" src="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002_ver2.png 489w, https://serverstadium.com/wp-content/uploads/2020/09/002_ver2-300x13.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Don&#8217;t forget</mark> to add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> to the Network Security Profile. For example, I&#8217;m allowing all IP Addresses to access <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 80</mark> on this Virtual Machine.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="780" height="78" class="wp-image-194" src="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-1.png 780w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-300x30.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-1-768x77.png 768w" sizes="(max-width: 780px) 100vw, 780px" /></figure>



<p class="wp-block-paragraph">After that, access the Virtual Machine Public IP Address with a web browser. If the installation succeeds, it should display the Apache2 Ubuntu Default Page, as shown below.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="823" height="301" class="wp-image-207" src="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4.png 823w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-300x110.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/004_ver2-4-768x281.png 768w" sizes="(max-width: 823px) 100vw, 823px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 2 &#8211; Installing MySQL</strong></h2>



<p class="wp-block-paragraph">If Apache2 is a web server, MySQL acts as RDBMS (Relational Database Management System) on LAMP. MySQL is a Database Management System that is quite popular for the PHP programming language.<br />To install MySQL on Ubuntu, type the command :</p>



<pre class="wp-block-code"><code># apt install mysql-server</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="540" height="22" class="wp-image-213" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1.png 540w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-1-300x12.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p class="wp-block-paragraph">After the installation process is complete, running a series of processes aimed at improving MySQL security is recommended. To run the process, type the command :</p>



<pre class="wp-block-code"><code># mysql_secure_installation</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="397" height="30" class="wp-image-216" src="https://serverstadium.com/wp-content/uploads/2020/09/002.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002.png 397w, https://serverstadium.com/wp-content/uploads/2020/09/002-300x23.png 300w" sizes="(max-width: 397px) 100vw, 397px" /></figure>



<p class="wp-block-paragraph">A new message will pop up; there is an option if you want to enable the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; feature.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="487" height="164" class="wp-image-219" src="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-2.png 487w, https://serverstadium.com/wp-content/uploads/2020/09/003-2-300x101.png 300w" sizes="(max-width: 487px) 100vw, 487px" /></figure>



<p class="wp-block-paragraph">This tool checks the password strength and allows MySQL users to set only those passwords which are secure enough. There is 3 level :</p>



<pre class="wp-block-code"><code>- LOW --&gt; Length &gt;= 8
- MEDIUM --&gt; Length &gt;= 8, numeric, mixed case, and special characters
- STRONG --&gt; Length &gt;= 8, numeric, mixed case, special characters, and dictionary</code></pre>



<p class="wp-block-paragraph">Press y / Y if you want to use &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">VALIDATE PASSWORD</span>&#8221; or press n / N if you don&#8217;t want to use it.</p>



<p class="wp-block-paragraph">Set the <span class="has-inline-color has-vivid-cyan-blue-color">root</span> MySQL user password by filling in these prompts with your desired password.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="276" height="75" class="wp-image-220" src="https://serverstadium.com/wp-content/uploads/2020/09/004.png" alt="" /></figure>



<p class="wp-block-paragraph">Removing the &#8220;anonymous&#8221; MySQL users before moving into a production state is advised. Press y / Y to remove the &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">anonymous</span>&#8221; MySQL user on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="478" height="131" class="wp-image-221" src="https://serverstadium.com/wp-content/uploads/2020/09/005.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/005.png 478w, https://serverstadium.com/wp-content/uploads/2020/09/005-300x82.png 300w" sizes="(max-width: 478px) 100vw, 478px" /></figure>



<p class="wp-block-paragraph">Then, to secure MySQL from a remote connection. Root login by remote access has to disable on the next pop-up.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="520" height="93" class="wp-image-222" src="https://serverstadium.com/wp-content/uploads/2020/09/006.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/006.png 520w, https://serverstadium.com/wp-content/uploads/2020/09/006-300x54.png 300w" sizes="(max-width: 520px) 100vw, 520px" /></figure>



<p class="wp-block-paragraph">Same with the anonymous MySQL user, it is advised to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database before moving into a production state. Press y / Y to remove &#8220;<span class="has-inline-color has-vivid-cyan-blue-color">test</span>&#8221; named database on the next pop-up message.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="581" height="108" class="wp-image-223" src="https://serverstadium.com/wp-content/uploads/2020/09/007.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/007.png 581w, https://serverstadium.com/wp-content/uploads/2020/09/007-300x56.png 300w" sizes="(max-width: 581px) 100vw, 581px" /></figure>



<p class="wp-block-paragraph">Press y / Y to reload the privilege tables so the several configurations above will apply.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="512" height="71" class="wp-image-224" src="https://serverstadium.com/wp-content/uploads/2020/09/008.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/008.png 512w, https://serverstadium.com/wp-content/uploads/2020/09/008-300x42.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<p class="wp-block-paragraph">To test the MySQL <span class="has-inline-color has-vivid-cyan-blue-color">root</span> user locally, test it by typing the command :</p>



<pre class="wp-block-code"><code># mysql -u root -p</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="333" height="22" class="wp-image-225" src="https://serverstadium.com/wp-content/uploads/2020/09/009.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/009.png 333w, https://serverstadium.com/wp-content/uploads/2020/09/009-300x20.png 300w" sizes="(max-width: 333px) 100vw, 333px" /></figure>



<p class="wp-block-paragraph">Then, fill in the password on the password prompt that appears.<br />The MySQL prompt will appear and be ready to use if the credential is correct.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="564" height="201" class="wp-image-226" src="https://serverstadium.com/wp-content/uploads/2020/09/010.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/010.png 564w, https://serverstadium.com/wp-content/uploads/2020/09/010-300x107.png 300w" sizes="(max-width: 564px) 100vw, 564px" /></figure>



<p class="wp-block-paragraph"><mark class="has-inline-color has-vivid-red-color" style="background-color: rgba(0, 0, 0, 0);">Remember</mark>, if you want to use the MySQL remote connection, add <mark class="has-inline-color has-vivid-cyan-blue-color" style="background-color: rgba(0, 0, 0, 0);">port 3306</mark> to the Network Security Profile that the Virtual Machine uses.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="771" height="65" class="wp-image-227" src="https://serverstadium.com/wp-content/uploads/2020/09/011.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/011.png 771w, https://serverstadium.com/wp-content/uploads/2020/09/011-300x25.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/011-768x65.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Step 3 &#8211; Installing PHP</strong></h2>



<p class="wp-block-paragraph">We have Apache2 and MySQL installed as a part of the LAMP installation. PHP is needed in this 3rd step as a scripting language for LAMP. According to <a href="https://w3techs.com/technologies/details/pl-php" target="_blank" rel="noreferrer noopener">w3techs data</a>, PHP is used by <strong>78,9%</strong> of websites on the internet. This makes PHP a good choice for a server-side programming language for your website.</p>



<p class="wp-block-paragraph">Install PHP by typing the command :</p>



<pre class="wp-block-code"><code># apt install php php-mysql libapache2-mod-php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="601" height="18" class="wp-image-234" src="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2.png 601w, https://serverstadium.com/wp-content/uploads/2020/09/001_ver2-2-300x9.png 300w" sizes="(max-width: 601px) 100vw, 601px" /></figure>



<p class="wp-block-paragraph">Explanation :</p>



<pre class="wp-block-code"><code>- php : php core package
- php-mysql : PHP module that allows PHP to communicate with MySQL-based database
- libapache2-mod-php : PHP module that enable Apache2 to handle PHP files</code></pre>



<p class="wp-block-paragraph">After PHP is installed, you can check the PHP version by typing the command :</p>



<pre class="wp-block-code"><code># php -v</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="462" height="79" class="wp-image-237" src="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/002-1.png 462w, https://serverstadium.com/wp-content/uploads/2020/09/002-1-300x51.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></figure>



<p class="wp-block-paragraph">To test the PHP installation and see the installed PHP&#8217;s complete info, make a new PHP file on <span class="has-inline-color has-vivid-cyan-blue-color">/var/www/html</span> directory with any text editor and name it <span class="has-inline-color has-vivid-red-color">info.php</span>. The content of the info.php must be like below :</p>



<pre class="wp-block-code"><code>&lt;?php
        phpinfo();
?&gt;</code></pre>



<p class="wp-block-paragraph">Save the file, and then access it from the web browser by URL :</p>



<pre class="wp-block-code"><code>http://YOUR_VM_IP_ADDRESS/info.php</code></pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="947" height="678" class="wp-image-239" src="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2020/09/003-3.png 947w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-300x215.png 300w, https://serverstadium.com/wp-content/uploads/2020/09/003-3-768x550.png 768w" sizes="(max-width: 947px) 100vw, 947px" /></figure>



<p class="wp-block-paragraph">As we can see info.php file displayed complete information for PHP that was installed on the Ubuntu ServerStadium Virtual Machine.</p>



<p class="wp-block-paragraph">Congratulations! You have now configured a LAMP stack on Ubuntu ServerStadium Virtual Machine.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">In this guideline, we have installed and configured LAMP stack on the Ubuntu Virtual Machine ServerStadium environment for serving PHP websites and applications using Apache2 as a web server and MySQL as a database management system.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/installing-lamp-in-ubuntu/">Installing LAMP in Ubuntu</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
