<?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>Route of Queue &#187; SQL</title>
	<atom:link href="http://www.routeofqueue.com/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.routeofqueue.com</link>
	<description>I have issues</description>
	<lastBuildDate>Sun, 30 May 2010 11:18:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>&#8220;You do not have sufficient permissions to access this page&#8221; after WordPress upgrade</title>
		<link>http://www.routeofqueue.com/2009/07/you-do-not-have-sufficient-permissions-to-access-this-page-after-wordpress-upgrade/</link>
		<comments>http://www.routeofqueue.com/2009/07/you-do-not-have-sufficient-permissions-to-access-this-page-after-wordpress-upgrade/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 18:45:47 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Hints and Tips]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[File]]></category>
		<category><![CDATA[meta key]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[prefix]]></category>
		<category><![CDATA[REPLACE]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[sql statements]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[usermeta]]></category>
		<category><![CDATA[warning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://www.routeofqueue.com/?p=76</guid>
		<description><![CDATA[If you&#8217;ve done a wordpress upgrade which included either copying another wp database or changing the current one&#8217;s table prefix (as well as changing the $table_prefix PHP variable in your config file,) you will most likely be met with this warning when you try to log in: You do not have sufficient permissions to access [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve done a wordpress upgrade which included either copying another wp database or changing the current one&#8217;s table prefix (as well as changing the $table_prefix PHP variable in your config file,) you will most likely be met with this warning when you try to log in:</p>
<blockquote><p>You do not have sufficient permissions to access this page.</p></blockquote>
<p>The reason for this is that everything in wordpress that accesses info in the db does so from PHP using the $table_prefix variable, and when you first installed your blog, a couple of options are set in the database that include that value, which makes it not really so dynamic! ;)</p>
<p>After rooting through my db, I found 5 or 6 values that still had the old table prefix in &#8211; mostly in the `usermeta` table, but also one in the `options` table. To make sure I got them all, I ran these simple SQL statements in phpMyAdmin to update all the values:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`wp2_usermeta`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`meta_key`</span> <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`meta_key`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'wp_'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'wp2_'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`wp2_options`</span> <span style="color: #993333; font-weight: bold;">SET</span> <span style="color: #ff0000;">`option_name`</span> <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`option_name`</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'wp_'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'wp2_'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong><em>(note: please be sure to backup your database before you execute any SQL on it &#8211; if something goes wrong, there&#8217;s not a lot you can do to recover it without a backup!)</em></strong></p>
<p>In those two examples, assume the original prefix was &#8220;wp&#8221; and the new one is &#8220;wp2&#8243;.</p>
<p>With that done, I can now log in to my newly upgraded blog again! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.routeofqueue.com/2009/07/you-do-not-have-sufficient-permissions-to-access-this-page-after-wordpress-upgrade/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

