在Debian系統中,您可以使用systemctl命令來管理MySQL服務。以下是一些常用的命令:
sudo systemctl start mysql
sudo systemctl stop mysql
sudo systemctl restart mysql
sudo systemctl status mysql
sudo systemctl enable mysql
sudo systemctl disable mysql
mysql --help | grep "datadir"
sudo tail -f /var/log/mysql/error.log
sudo mysql_secure_installation
請注意,根據您的Debian版本和MySQL版本,上述命令可能略有不同。例如,在某些Debian版本中,MySQL服務可能被稱為mysqld而不是mysql。在這種情況下,請相應地替換命令中的服務名稱。