mysql免密登录
原创
©著作权归作者所有:来自51CTO博客作者wx63159e54cdd9a的原创作品,请联系作者获取转载授权,否则将追究法律责任
有时候有人想偷懒,直接免密登录mysql。可以按照以下方法操作
1.编辑配置文件
vim /root/.my.cnf [client] user=root password=123 |
2.修改权限
3.登录查看
[root@localhost ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 5.7.20-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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.root@localhost :(none)12:09:35> |
可以了,现在能免密登录了!