dos进入mysql的实现方法

C:\Users\zsh>mysql -h 127.0.0.1 -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 5.0.27-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)

mysql>

这样是不行的:

C:\Users\zsh>test -h 127.0.0.1 -u root -p;

'test' 不是内部或外部命令,也不是可运行的程序或批处理文件。

C:\Users\zsh>test -h 127.0.0.1 -u root -p

'test' 不是内部或外部命令,也不是可运行的程序或批处理文件。

由此可见:

C:\Users\zsh>mysql -h 主机ip -u 用户名 -p;

只要知道了主机ip 和用户名即可同时要在环境变量里面配置了mysql安装的bin目录

相关文章

navicat查看某个表的所有字段的详细信息 navicat设计表只能一...
文章浏览阅读4.3k次。转载请把头部出处链接和尾部二维码一起...
文章浏览阅读488次。恢复步骤概要备份frm、ibd文件如果mysql...
文章浏览阅读225次。当MySQL单表记录数过大时,增删改查性能...
文章浏览阅读1.5k次。Mysql创建、删除用户MySql中添加用户,新...
MySQL是一种开源的关系型数据库管理系统,被广泛应用于各类应...