命令提示符下如何登录MySQL数据库

登录linux后输入如下命令

C:\Users\Administrator>mysql -h localhost -P 3306 -uroot -p      #(-P 后面是端口号,P是大写字母)

这时应该会出现类似下方的提示,需要你输入对应-u后面的用户所对应的密码:

Enter password: *********

如果密码输入正确,则会出现如下界面,表示登录成功:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 5.6.21-log MySQL Community Server (GPL)
  
Copyright (c) 2000, 2014, 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>
原文链接:,转发请注明来源!

发表评论

要发表评论,您必须先登录