连接远程服务器的mysql,并对其进行操作

连接远程服务器的mysql,并对其进行操作
然后输入mysql -u root -p回车,输入密码。
然后就可以根据sql命令进行操作啦。

eg:

  • show databases;
    查看所有的数据库
  • use 数据库名;
    使用该数据库
  • show tables;
    查看该数据库下的所有数据库表
  • select * from student;
    查看student表中的所有内容
  • delete from student where 1;
    删除student表中的所有内容(小技巧,删除的时候加个where判断,防止误删数据)
    。。。
    要注意呀,update也是数据库的关键字