mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
Updated MySQL tips (markdown)
parent
edbfd8d0c8
commit
2cc1fce79b
1 changed files with 30 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
This tips were prepared for [[Install Tracks-2.5 on Ubuntu 20.10]]
|
||||
|
||||
<h3 class="title">MySQL 8.0 Reference Manual</h3>
|
||||
<p>
|
||||
<a href="https://dev.mysql.com/doc/refman/8.0/en/">https://dev.mysql.com/doc/refman/8.0/en/</a>
|
||||
|
|
@ -64,4 +66,31 @@
|
|||
<li>$MYSQL_HOME/my.cnf</li>
|
||||
<li>[datadir]/my.cnf</li>
|
||||
<li>~/.my.cnf</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<h3>Import Export the content of the database</h3>
|
||||
<blockquote>
|
||||
<p>>mysqldump -u <strong>user_name</strong> -p <strong>db_name</strong> > /tmp/partkeepr.sql</p>
|
||||
</blockquote>
|
||||
<p>set <strong>user_name</strong> and <strong>db_name</strong> accordingly.</p>
|
||||
<p>e.g.</p>
|
||||
<blockquote>
|
||||
<p>>mysqldump -u daniel -p tempe > ~/tracks.sql</p>
|
||||
</blockquote>
|
||||
<p>The command will ask for the password of the SQL user.</p>
|
||||
<p>If you get the error</p>
|
||||
<p>mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces</p>
|
||||
<p>if your user root doesn't have a password ... you can use root (note that the line is without -p)</p>
|
||||
<blockquote>
|
||||
<p>>mysqldump -u root tempe > ~/tracks.sql</p>
|
||||
</blockquote>
|
||||
<h3>Import the SQL file</h3>
|
||||
<br/>
|
||||
<p>Sometimes it is required to drop all the table before the import, you need to check for your case.</p>
|
||||
<p>at the command line do</p>
|
||||
<blockquote>
|
||||
<p>>mysql -u <strong>user_name</strong> -p <strong>db_name</strong> < /tmp/partkeepr.sql</p>
|
||||
</blockquote>
|
||||
<p>e.g.</p>
|
||||
<blockquote>
|
||||
<p>>mysql -u daniel -p tempe < ~/tracks.sql</p>
|
||||
</blockquote>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue