<?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>Techy Things &#187; mariadb</title>
	<atom:link href="https://tech.yipp.ca/category/mariadb/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.yipp.ca</link>
	<description>Just another Yipp.ca Blogs site</description>
	<lastBuildDate>Thu, 01 May 2025 18:06:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>The four causes for &quot;No connection could be made because the target machine actively refused it&quot; in mariaDB or mySQL</title>
		<link>https://tech.yipp.ca/mariadb/four-causes-connection-made-target-machine-actively-refused-mariadb-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=four-causes-connection-made-target-machine-actively-refused-mariadb-mysql</link>
		<comments>https://tech.yipp.ca/mariadb/four-causes-connection-made-target-machine-actively-refused-mariadb-mysql/#comments</comments>
		<pubDate>Sat, 14 Sep 2024 19:36:05 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[mariadb]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4373</guid>
		<description><![CDATA[<p>The scenario is you trying to connect to mysql on another remote server IP. The machine is refusing to even connect you. Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No connection could be made because&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/mariadb/four-causes-connection-made-target-machine-actively-refused-mariadb-mysql/">The four causes for "No connection could be made because the target machine actively refused it" in mariaDB or mySQL</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The scenario is you trying to connect to mysql on another remote server IP. The machine is refusing to even connect you.</p>
<p>Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. in U:\Webpages\yipp.ca\app\src\db.inc.php:28 Stack trace: #0 U:\Webpages\yipp.ca\app\src\db.inc.php(28): PDO-&gt;__construct('mysql:host=37.2...', 'yipp', 'hPKcxOvXnwvPX5R...') #1 U:\Webpages\yipp.ca\app\src\db.inc.php(38): getDB() #2 U:\Webpages\yipp.ca\app\src\routes.php(27): require_once('U:\\Webpages\\yip...') #3 U:\Webpages\yipp.ca\app\public_html\index.php(28): require('U:\\Webpages\\yip...') #4 {main} thrown in U:\Webpages\yipp.ca\app\src\db.inc.php on line 28</p>
<p>Check the causes &amp; solutions below.</p>
<h3>Reason #1</h3>
<p>mariaDB or mySQL is not listening on the public IP but only on localhost.</p>
<p>Put the public IP of the server in /etc/mysql/mariadb.conf.d/50-server.cnf at the line "bind-address".<br />
For example if your server IP is 123.123.123.123:</p>
<pre>(...)
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 123.123.123.13</pre>
<p>Some people like putting 0.0.0.0 there which will require less editing and downtime if your IP changes or you migrate to another server/IP.</p>
<h3>Reason #2</h3>
<p>You are connecting to the wrong server IP. Your server IP might have changed. Or if using the hostname, make sure the hostname resolves to the right IP. Try pinging it to see the IP it resolves to.</p>
<h3>Reason #3</h3>
<p>The SQL user you are trying to reach doesn't have permission to login from your client IP.<br />
Usually mySQL or mariaDB will block any connection from a remote IP for a user unless the user@yourip is whitelisted.<br />
This whitelisting is done directly in the users table in SQL.</p>
<h3>Reason #4</h3>
<p>iptables or other firewall are actively blocking the connection. Disable temporarily the firewall to test if this is the case. Note that there could be multiple reasons at once. Before trying this, make sure reasons 1 to 3 are not happening.</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/mariadb/four-causes-connection-made-target-machine-actively-refused-mariadb-mysql/">The four causes for "No connection could be made because the target machine actively refused it" in mariaDB or mySQL</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/mariadb/four-causes-connection-made-target-machine-actively-refused-mariadb-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mariaDB Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83</title>
		<link>https://tech.yipp.ca/mariadb/mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83</link>
		<comments>https://tech.yipp.ca/mariadb/mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83/#comments</comments>
		<pubDate>Mon, 28 Mar 2022 03:55:23 +0000</pubDate>
		<dc:creator><![CDATA[frank]]></dc:creator>
				<category><![CDATA[mariadb]]></category>

		<guid isPermaLink="false">http://tech.yipp.ca/?p=4199</guid>
		<description><![CDATA[<p>Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83 in /var/www/app/src/db.inc.php:28 Stack trace: #0 /var/www/app/src/db.inc.php(28): PDO-&#62;__construct() #1 /var/www/app/src/db.inc.php(38): getDB() #2 /var/www/app/src/routes.php(26): require_once('/var/www/thecan...') #3 /var/www/app/public_html/index.php(27): require('/var/www/thecad...') #4 {main} Next PDOException:&#46;&#46;&#46;</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/mariadb/mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83/">mariaDB Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><b>Fatal error</b>: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83 in /var/www/app/src/db.inc.php:28 Stack trace: #0 /var/www/app/src/db.inc.php(28): PDO-&gt;__construct() #1 /var/www/app/src/db.inc.php(38): getDB() #2 /var/www/app/src/routes.php(26): require_once('/var/www/thecan...') #3 /var/www/app/public_html/index.php(27): require('/var/www/thecad...') #4 {main} Next PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away in /var/www/app/src/db.inc.php:28 Stack trace: #0 /var/www/app/src/db.inc.php(28): PDO-&gt;__construct() #1 /var/www/app/src/db.inc.php(38): getDB() #2 /var/www/app/src/routes.php(26): require_once('/var/www/thecad...') #3 /var/www/app/public_html/index.php(27): require('/var/www/thecad...') #4 {main} thrown in <b>/var/www/app/src/db.inc.php</b> on line <b>28</b></p>
<p>Why? Look into the error.log</p>
<p><strong>2022-03-27 23:40:48 53 [Warning] Access denied for user 'thecadhosting'@'localhost' (using password: YES)</strong></p>
<h2>Solution</h2>
<p>It's just a password failure. With a very bad error message percolating up.</p>
<p>Checkout the TABLE users</p>
<p><strong><span class="cm-keyword"><a class="cm-sql-doc" href="https://thecanadianhosting.co/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/select.html" target="mysql_doc">SELECT</a></span> <span class="cm-operator">*</span> <span class="cm-keyword">FROM</span> <span class="cm-variable-2">`user`</span></strong></p>
<p>Verify that the three column for the user you are using are OK</p>
<p><em>Host</em><br />
<em>User </em><br />
<em>Password</em></p>
<p>If it's localhost, you can also add another line with the IP, or make sure there is no other line with the local IP that has a different password.</p>
<p>The User is the user used in the DB connection</p>
<p>If it still doesn't work, try the password with the CLI command. If it doesn't work reset the password.</p>
<p>You can also copy paste the Password column value from one row to another to use the same password.</p>
<h2>Solution #2</h2>
<p>There can be a firewall actively blocking the connection. Some popular firewalls are ufw and iptables</p>
<p><strong>ufw</strong></p>
<pre>sudo ufw allow from &lt;my-pc-ip&gt; to any port 3306</pre>
<p>The aboves opens only to one IP</p>
<p><strong>iptables</strong></p>
<pre>sudo iptables -A INPUT -p tcp --destination-port 3306 -j ACCEPT</pre>
<p>The aboves opens to all IP</p>
<p>The post <a rel="nofollow" href="https://tech.yipp.ca/mariadb/mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83/">mariaDB Fatal error: Uncaught PDOException: Packets out of order. Expected 0 received 1. Packet size=83</a> appeared first on <a rel="nofollow" href="https://tech.yipp.ca">Techy Things</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://tech.yipp.ca/mariadb/mariadb-fatal-error-uncaught-pdoexception-packets-order-expected-0-received-1-packet-size83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
