<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Mysql on Simplestory</title><link>https://simplestory.github.io/en/tags/mysql/</link><description>Recent content in Mysql on Simplestory</description><generator>Hugo</generator><language>en-us</language><copyright>Simplestory</copyright><lastBuildDate>Fri, 01 Dec 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://simplestory.github.io/en/tags/mysql/index.xml" rel="self" type="application/rss+xml"/><item><title>MySQL Data File Paths on Linux</title><link>https://simplestory.github.io/en/posts/20171201_7eec743fae4833726b0d923cf6db1da6/</link><pubDate>Fri, 01 Dec 2017 00:00:00 +0000</pubDate><guid>https://simplestory.github.io/en/posts/20171201_7eec743fae4833726b0d923cf6db1da6/</guid><description>&lt;p&gt;&lt;strong&gt;Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After logging into MySQL, you can use the following command to query where the related files are stored:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variables&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;like&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%dir%&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The output is shown below:&lt;/p&gt;
&lt;p&gt;&lt;img loading="lazy" src="https://simplestory-blog-img.oss-cn-guangzhou.aliyuncs.com/in_posts/20171201/mysql.png" title="mysql"&gt;&lt;/p&gt;
&lt;p&gt;Usually these are:&lt;/p&gt;
&lt;p&gt;The default location of the database files is: &lt;code&gt;/usr/share/mysql/&lt;/code&gt;
Configuration file: &lt;code&gt;/etc/mysql/my.cnf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Database directory: &lt;code&gt;/var/lib/mysql&lt;/code&gt;
Configuration directory: &lt;code&gt;/etc/share/mysql&lt;/code&gt; (mysql.server command and configuration files)
MySQL related commands: &lt;code&gt;/usr/bin&lt;/code&gt;
Startup scripts: &lt;code&gt;/etc/init.d/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One way to start mysql safely: /usr/bin/mysqld_safe-user=root&amp;amp;&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>