没有不值得去解决的问题,也没有不值得去学习的技术!

执行命令:docker exec -i object-mysql mysql -uroot -proot object_store < object_store.sql ,报错:mysql: [Warning] Using a password on the command line interface can be insecure.

执行命令:docker exec -i wshop-mysql mysql -uroot -proot wshop_store < wshop_store.sql ,报错:mysql: [Warning] Using a password on the command line interface can be insecure.。

1、执行命令:docker exec -i object-mysql mysql -uroot -proot object_store < object_store.sql ,报错:mysql: [Warning] Using a password on the command line interface can be insecure.。如图1

执行命令:docker exec -i object-mysql mysql -uroot -proot object_store < object_store.sql ,报错:mysql: [Warning] Using a password on the command line interface can be insecure.。
图1

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ docker exec -i object-mysql mysql -uroot -proot object_store < object_store.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump: [Warning] Using a password on the command line interface can be insec' at line 1


2、进入 MySQL 容器,查看数据库 object_store,显示所有表,响应:Empty set (0.00 sec)。如图2

进入 MySQL 容器,查看数据库 object_store,显示所有表,响应:Empty set (0.00 sec)。
图2

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| object_store        |
+--------------------+
5 rows in set (0.00 sec)

mysql> use object_store
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql>


3、最终决定导入 SQL 文件至容器中。docker cp 本地文件路径 ID全称:容器路径。如图3

最终决定导入 SQL 文件至容器中。docker cp 本地文件路径 ID全称:容器路径。
图3

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS        PORTS                                            NAMES
b1209481ee68   startup_object-ingress    "/docker-entrypoint.…"   18 hours ago   Up 18 hours   0.0.0.0:80->80/tcp                               object-ingress
dba654382ac1   startup_object-fpm        "docker-php-entrypoi…"   18 hours ago   Up 18 hours   9000/tcp                                         object-fpm
fd71ad5062cb   mailhog/mailhog:latest   "MailHog"                18 hours ago   Up 18 hours   0.0.0.0:1025->1025/tcp, 0.0.0.0:8025->8025/tcp   object-mailhog
60bc28cc2674   mysql:5.7                "docker-entrypoint.s…"   18 hours ago   Up 18 hours   3306/tcp, 33060/tcp                              object-mysql
065679f42b04   wordpress:latest         "docker-entrypoint.s…"   18 hours ago   Up 18 hours   80/tcp                                           object-wordpress
81ae20330d88   redis:alpine             "docker-entrypoint.s…"   18 hours ago   Up 18 hours   6379/tcp                                         object-redis
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ docker inspect -f '{{.Id}}' object-mysql
60bc28cc267453f8f1df2655378023d241706177bb55b57cb46477a4d988f5d2
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ pwd
/mnt/e/wwwroot/xgrit
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ ls
object  object-wp  object_store.sql  object_wp.sql
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$ docker cp /mnt/e/wwwroot/xgrit/object_store.sql 60bc28cc267453f8f1df2655378023d241706177bb55b57cb46477a4d988f5d2:/object_store.sql
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/xgrit$


4、进入容器中,登录 MySQL 后,执行命令:source ./object_store.sql;。如图4

进入容器中,登录 MySQL 后,执行命令:source ./object_store.sql;。
图4

mysql> use object_store;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> source ./object_store.sql;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump: [Warning] Using a password on the command line interface can be insec' at line 1
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)


Linux 服务器运维、部署与线上故障排查

如果你的网站或后端服务部署在 Linux 服务器上,遇到访问异常、Nginx 配置问题、MySQL / Redis 异常、Docker 服务不可用、磁盘占满、CPU / 内存过高等问题,可以联系我做一次远程排查。

适合以下场景:
✅ 网站打不开或访问不稳定
✅ Nginx / PHP-FPM 配置异常
✅ MySQL / Redis 性能或连接问题
✅ Docker 服务部署与维护
✅ 服务器迁移与环境配置
✅ CPU / 内存 / 磁盘异常排查

服务内容:
✅ Linux 环境检查
✅ 网站部署与迁移
✅ Nginx / PHP-FPM / MySQL / Redis 排查
✅ Docker 配置与维护
✅ 服务器性能分析
✅ 长期远程运维支持

如需咨询,请联系我,并注明:Linux 运维咨询

联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理