mysql

 mysql -u root -p

mysql -u root -p dc169b6239

登陆数据库的方法:

mysql -uroot -p

然后再输入相应的密码。
显示数据库(注意有分号)

show databases;
  1. mysqldump 下载数据问题
    由于权限不够,需要采用以下指令可以跨越权限
sudo mysqldump -u root -ppwd db --skip-lock-tables > ~/mysql.sql

5.如何source时不产生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.

你可能感兴趣的:(mysql)