gpt4 book ai didi

MySQL Won't Source, then won't connect

转载 作者:行者123 更新时间:2023-11-30 23:33:07 24 4
gpt4 key购买 nike

我正在尝试使用本地主机将文本 (.sql) 文件加载到 Windows 2008 R2 上的 MySQL 数据库中,但出现奇怪的错误,数据库名称的第一个字母被截断。我首先执行“show databases”以确认我在其中并且字符串正确,然后更改为目标数据库,然后运行“Load E:\MySQL\rosedestinationlog.sql;

为避免歧义,我以 root 身份登录。

这将返回奇怪的错误 1049,后跟缺少第一个字符的数据库名称。如果我然后尝试做任何其他事情,例如再次运行“显示数据库”,我会收到连接丢失的错误消息。退出 CL 并重新启动它允许我重新连接,但之后出现相同的错误。

我已经在到 TCP 的两个方向上都打开了端口 3006。我可以获取其他一些文件,但其他人遇到了同样的错误。我可以在 Mac 上毫无问题地加载这些文件。以下是 CL 屏幕打印输出:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\Administrator> mysql -u root -p;
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 61
Server version: 5.5.21 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| akhf_beta |
| bank |
| mysql |
| performance_schema |
| rosecampdiary |
| rosedestinationlog |
| roseflightprep |
| ruredb |
| test |
+--------------------+
10 rows in set (0.00 sec)

mysql> use rosedestinationlog;
Database changed
mysql> source E:\MySQL\rosedestinationlog.sql;
ERROR:
Unknown command '\M'.
ERROR 1049 (42000): Unknown database 'osedestinationlog.sql;'
mysql> show databases;
No connection. Trying to reconnect...
ERROR 1049 (42000): Unknown database 'osedestinationlog.sql;'
ERROR:
Can't connect to the server

mysql>

最佳答案

运行时:

mysql> source E:\MySQL\rosedestinationlog.sql;

看起来反斜杠-M 被程序选中了。尝试将文件路径全部放在引号中,例如像这样的东西:

mysql> source 'E:\MySQL\rosedestinationlog.sql';

关于MySQL Won't Source, then won't connect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9562013/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com