linux中mysql客户端命令行连接不了 docker 创建的mysql
生活随笔
收集整理的這篇文章主要介紹了
linux中mysql客户端命令行连接不了 docker 创建的mysql
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
linux中mysql客戶端命令行連接不了 docker 創建的mysql
問題 :如題
a@z:~$ mysql -h localhost -p ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) a@z:~$ mysql -h 127.0.0.1 -p ERROR 1045 (28000): Access denied for user 'xiao'@'172.18.0.1' (using password: YES) a@z:~$ mysql -h 127.0.0.1 -p解決方案
連接ip地址的時候,寫 mysql 容器的ip
a@z:~$ mysql -u root -p -h 172.18.0.1 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 8.0.26 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.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.總結
以上是生活随笔為你收集整理的linux中mysql客户端命令行连接不了 docker 创建的mysql的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Linux】Ubuntu编写并运行第一
- 下一篇: 在使用pyrcc5编译二进制文件出现错误