mysql -u root -p
mysql -u root -p dc169b6239
登陸數(shù)據(jù)庫的方法:
mysql -uroot -p
然后再輸入相應(yīng)的密碼。
顯示數(shù)據(jù)庫(注意有分號)
show databases;
- mysqldump 下載數(shù)據(jù)問題
由于權(quán)限不夠,需要采用以下指令可以跨越權(quán)限
sudo mysqldump -u root -ppwd db --skip-lock-tables > ~/mysql.sql
5.如何source時不產(chǎn)生console output(控制臺輸出)
Disable console output when executing a SQL file using MySQL source command
mysql --user=myusername --password=mypassword --silent --force -b
The last -b option is used to disable beep on error.
Then I choose a database:
use Mydatabasename;
Then I execute SQL form a file like this:
source c:\x\y\z\myfile.sql
That's when things go slowly. I've executed part of the file before so the console is filled with duplicate row errors which slow execution badly. I get 5-10 statements executed per second. Without duplicate rows the code executes tens of thousands of statements (30k+) every 5 seconds.
I need to do this since the file is large and I can't execute it in one go.