博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
登录MySQL
阅读量:4189 次
发布时间:2019-05-26

本文共 1202 字,大约阅读时间需要 4 分钟。

明文密码登录

确保mysql服务器开启。

输入命令连接数据库:

mysql -u 用户名 -p密码

⚠️ -p密码 之间没有空格。

示例:

➜  ~ mysql -u root -p201910mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2764Server version: 5.7.21 MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

⚠️ 明文密码登录的优点是方便,直接使用一条命令就可以直接登录mysql数据库,缺点是安全性差,暴露了密码。

 

普通登录方式

确保mysql服务器开启。

输入命令连接数据库:

mysql -u root -p

接下来mysql提示输入登录密码。

➜  ~ mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2765Server version: 5.7.21 MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

 

转载地址:http://dfsoi.baihongyu.com/

你可能感兴趣的文章
二叉树的深度
查看>>
MySQL数据库入门(三)
查看>>
MySQL数据库入门(四)
查看>>
关于方法覆盖和属性覆盖的问题?
查看>>
JAVA中ListIterator和Iterator详解
查看>>
目标和
查看>>
跳跃游戏
查看>>
买卖股票的最佳时机 II
查看>>
分发饼干
查看>>
最低票价
查看>>
删列造序
查看>>
使括号有效的最少添加
查看>>
令牌放置
查看>>
回溯法思想
查看>>
子集和问题
查看>>
旅行售货员问题
查看>>
区域和检索 - 数组不可变
查看>>
整数分解
查看>>
最长有效括号
查看>>
救生艇
查看>>