实际应用中,不仅可以先登陆mysql再使用,还可以在链接的时候进行sql操作,此时需要加参数-e

例:

>mysql -hlocalhost -P8080 -uroot -p123456 -e'set names utf8;use report;select * from table;';

就是这样,-e中的语句需要用封号来分割。

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-10-26
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-09-26
  • 2022-12-23
相关资源
相似解决方案