Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据 mysqlcheck 手册,我可以执行以下操作:
mysqlcheck datatabase_name --auto-repair -ao -u="user" -p="password"
但是它从不接受密码。无论我使用 shell 登录还是数据库登录都没有关系。当我留下密码时,我可以在提示我输入密码后连接。我想把它放在一个 cron 脚本中,所以我需要能够将密码放在命令中。
如果需要,该命令将分析、优化和修复我也是对的吗?
尝试使用:
mysqlcheck datatabase_name --auto-repair -ao --user=user --password=password
或者-uuser or -ppassword should also work.
-uuser or -ppassword should also work.
不幸的是,我真的无法进一步深入了解您对mysqlcheck在您希望它执行的操作中的实际效果的查询。我怀疑它不会做真正提高数据库性能的事情,尽管比如添加放置良好的索引和优化查询以仅在必要时链接。