在Linux服務器上,登錄MySQL需要打開終端并輸入以下命令:
mysql -u用戶名 -p密碼
其中,用戶名和密碼需替換成您的MySQL用戶名和密碼。輸入完命令后,按下回車鍵,等待服務器連接MySQL。
如果您看到類似下面的界面,表示您已成功連接到MySQL:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1234 Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
從上面的界面可以看到,您已成功登錄MySQL。接下來,您可以開始操作您的MySQL數(shù)據(jù)庫了。