Linux/Mysql: Difference between revisions

From Wiki
No edit summary
(Weiterleitung nach Mysql erstellt)
Tag: New redirect
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
== List Databases ==
#REDIRECT [[Mysql]]
<pre>
mysql -u root -p
show databases;
mysql -u root -p -e 'show databases;'
</pre>
 
<pre>
echo "show databases;" | mysql
</pre>
 
== Dump Database ==
<pre>
mysqldump -u root -p databasename > databasename.sql
 
mysqldump -u root -p --quick --add-drop-table --complete-insert --allow-keywords databasename > databasename.sql
</pre>
 
== Import Database ==
<pre>
mysql -u root -p databasename < databasename.sql
</pre>
 
== Import Database in Docker ==
<pre>
docker exec -i mysql-container mysql -uuser -ppassword name_db < data.sql
</pre>
 
[[Category:Linux]]
[[Category:Linux/Services]]

Latest revision as of 12:48, 10 June 2020

Redirect to: