<?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>Control WebPanel Wiki &#187; mysql location</title>
	<atom:link href="http://wiki.centos-webpanel.com/tag/mysql-location/feed" rel="self" type="application/rss+xml" />
	<link>http://wiki.centos-webpanel.com</link>
	<description>CentOS WebPanel Wiki</description>
	<lastBuildDate>Wed, 12 Feb 2025 20:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>How to change MySQL Location</title>
		<link>http://wiki.centos-webpanel.com/how-to-change-mysql-location</link>
		<comments>http://wiki.centos-webpanel.com/how-to-change-mysql-location#comments</comments>
		<pubDate>Sun, 29 Mar 2015 20:43:20 +0000</pubDate>
		<dc:creator><![CDATA[publisher]]></dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql location]]></category>

		<guid isPermaLink="false">http://wiki.centos-webpanel.com/?p=212</guid>
		<description><![CDATA[How to Safely Change Location of the MySQL Data Directory (partition/disk) Most Used Cases are: - Useful for migration of the MySQL to SSD Disk and to get the best performances. - Useful if you are out of the disk space on your partition or a disk. In this tutorial we will move MySQL to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>How to Safely Change Location of the MySQL Data Directory (partition/disk)</strong></p>
<p><strong>Most Used Cases are:</strong><br />
- Useful for migration of the MySQL to SSD Disk and to get the best performances.<br />
- Useful if you are out of the disk space on your partition or a disk.</p>
<p>In this tutorial we will move MySQL to the <strong>/home</strong> folder.</p>
<p><strong>First Make the Backup of all databases</strong></p>
<pre>mysqldump --add-drop-table --all-databases | gzip > /home/alldatabases.sql.gz</pre>
<p><strong>Lets start migrating MySQL</strong></p>
<pre>service mysqld stop
cd /var/lib
mv mysql /home/mysql
ln -s /home/mysql mysql
chown -R mysql:mysql /home/mysql
service mysqld start</pre>
<p><b>for CentOS 7</b><br />
When using MariaDB and if you are moving it to /home then you also need to edit mariadb service file:<br />
<b>/usr/lib/systemd/system/mariadb.service</b> and change <b>ProtectHome=true</b> to <b>ProtectHome=false</b></p>
<p>After making changes, restart the service</p>
<pre>
systemctl daemon-reload
service mysql restart</pre>
<p><em>That is it, no other changes are required.</em></p>
<p><strong>CloudLinux &#038; CageFS</strong><br />
If you are running CloudLinux then you will need to update CageFS skeleton.<br />
Once you have done migration proceed with:</p>
<pre>/usr/sbin/cagefsctl -u </pre>
]]></content:encoded>
			<wfw:commentRss>http://wiki.centos-webpanel.com/how-to-change-mysql-location/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
