1.执行外部sql文件命令
source d:\test.sql
2 开启远程连接mysql
1.改表法
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从“localhost”改称“
x:\>mysql -u root -p123456
mysql> use mysql;
mysql> update user set host = ‘%’ where user = ‘root’;
mysql> select host, user from user;
mysql> flush privileges;ysql> flush privileges;
使修改生效。
2、授权法:
grant all PRIVILEGES on database.* to darling@'123.123.123.123' identified by '123456';
用户darling从ip为’123.123.123.123 的主机连接到mysql服务器,并使用123456作为密码
3 远程连接 mysql
mysql -h 192.168.0.33 -u root -p123456;
4 查询数据库里所有表的记录数
use information_schema;
mysql> select table_name, table_rows from tables where table_schema='spider';
利用mysql,系统表