<?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>error logs &#8211; Everything is Broken</title>
	<atom:link href="https://play.datalude.com/blog/tag/error-logs/feed/" rel="self" type="application/rss+xml" />
	<link>https://play.datalude.com/blog</link>
	<description>Efficiency vs. Inefficiency, in a no-holds barred fight.</description>
	<lastBuildDate>Wed, 14 Feb 2024 08:10:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Mysql 8 mysql_native_password deprecation error. MY-013360</title>
		<link>https://play.datalude.com/blog/2024/02/mysql-8-mysql_native_password-deprecation-error-my-013360/</link>
					<comments>https://play.datalude.com/blog/2024/02/mysql-8-mysql_native_password-deprecation-error-my-013360/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 14 Feb 2024 08:10:10 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[error logs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=731</guid>

					<description><![CDATA[Checking in on a Mysql 8.x server the other day I found the following in the /var/log/mysql/error.log But not just one of them. Lots and lots of them, one a second, for the last few months. To be sure it didn't seem critical, but having lots of crap in your logs means its obscuring the really ... <a title="Mysql 8 mysql_native_password deprecation error. MY-013360" class="read-more" href="https://play.datalude.com/blog/2024/02/mysql-8-mysql_native_password-deprecation-error-my-013360/" aria-label="Read more about Mysql 8 mysql_native_password deprecation error. MY-013360">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Checking in on a Mysql 8.x server the other day I found the following in the /var/log/mysql/error.log </p>



<pre class="wp-block-code"><code>&#91;Warning] &#91;MY-013360] &#91;Server] Plugin mysql_native_password reported: ''mysql_native_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'</code></pre>



<p class="wp-block-paragraph">But not just one of them. Lots and lots of them, one a second, for the last few months. To be sure it didn't seem critical, but having lots of crap in your logs means its obscuring the really important bits, and making it hard to detect real problems. </p>



<p class="wp-block-paragraph">So how to get rid of them? Well not too hard as it happens. First option is to suppress them in your mysql config. I didn't know this was an option, but yes, you can add the following line to your mysqld config file and they don't get logged any more. </p>



<pre class="wp-block-code"><code>log_error_suppression_list='MY-013360'</code></pre>



<span id="more-731"></span>



<p class="wp-block-paragraph">And restart. This can also be set without restarting the server using SET GLOBAL:</p>



<pre class="wp-block-code"><code>mysql> set global log_error_suppression_list='MY-013360' ;<br>Query OK, 0 rows affected (0.00 sec)<br></code></pre>



<p class="wp-block-paragraph">Very useful if you just want to get rid of it while you're troubleshooting something. But now to get down to the root cause. How do we fix the error completely. Again not too hard. First of all we can take a look and see which user is the offender, and the default server policy. </p>



<pre class="wp-block-code"><code>mysql -e " show variables like 'default_authentication_plugin';"<br>  default_authentication_plugin = caching_sha2_password<br><br>mysql -e "select Host,User,plugin FROM  mysql.user;"<br>| Host      | User               | plugin                |<br>| localhost | guilty-user          | mysql_native_password |<br>| localhost | mysql.session    | caching_sha2_password |<br>| localhost | mysql.sys         | caching_sha2_password |<br>| localhost | root               | auth_socket             |<br></code></pre>



<p class="wp-block-paragraph">Well it was guilty-user, what a surprise. So lets fix that. The current password for guilty-user will be known to you &#8212; it'll be in the WP config file, or database connection string of whatever app is using it. Lets say its "F$ntasticPW", so we just ALTER the user using the same password:</p>



<pre class="wp-block-code"><code>mysql -e "ALTER USER 'guilty-user'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'F$ntasticPW';"</code></pre>



<p class="wp-block-paragraph">And there we have it. The app shouldn't even blink. And your monster db logs are gone. But as always, take a db backup before you try. </p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2024/02/mysql-8-mysql_native_password-deprecation-error-my-013360/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
