vi ~/.my.cnf
将下边的内容放入上方的文件当中
[client]
host='localhost'
#登录的用户名
user='system'
#用户的密码
password='guan'
2.编辑完成的文件如下图:
[root@master2 ~]# cat ~/.my.cnf
[client]
host='localhost'
#登录的用户名
user='system'
#用户的密码
password='guan'
3.测试
保存后 , 再登录mysql的时候,只需要输入mysql们不需要加后面的用户名和密码
[root@master2 ~]# mysql#后边没有跟用户名和密码
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.14-log MySQL Community Server (GPL)
Copyright (c) 2000, 2013, 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怎么用cmd登陆】关于mysql本机怎么登陆和mysql怎么用cmd登陆的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- 老式电视闪屏带黑屏怎么办,老式电视闪屏带黑屏怎么办视频
- 荣耀鸿蒙系统投屏,华为手机鸿蒙系统投屏
- 钉钉钉怎么开启会议直播,钉钉钉怎么开启会议直播功能
- mysql怎么配置主从 mysql主从配置文件
- 如何看待电商包装,如何看待电商包装的是与非
- 上海口碑好的erp系统答疑解惑,erpfny_sh com
- 电脑装两张显卡怎么装驱动,电脑装两张显卡怎么装驱动的
- python中求函数 python如何求
- 设计什么cpu好,学设计电脑cpu用哪个