planRAG运行记录
- 代码仓库:https://github.com/myeon9h/PlanRAG
neo4j的连接
-
下载neo4j客户端
-
-
save之后即可成功连接
连接neo4j权限问题解决
-
问题1:如何找到
neo4j.conf
文件-
解决1:可以通过设置环境变量
NEO4J_CONF
来指定neo4j.conf
文件的位置,会返回一个路径echo $NEO4J_CONF
-
解决2:如果不确定配置文件的位置,可以使用
find
命令在文件系统中搜索它,但需要sudo权限sudo find / -name "neo4j.conf"
-
-
找到
neo4j.conf
文件后,对其中的修改neo4j.conf配置文件,取消验证机制,修改如下: -
neo4j图数据库情况
MATCH (n) RETURN n
在这里插入图片描述
mysql的连接
本地启动mysql服务问题解决
-
问题1:sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, “Access denied for user ‘public’@‘localhost’ (using password: NO)”) (Background on this error at: https://sqlalche.me/e/20/e3q8)
- 解决1:修改代码
# db_engine = SQLDatabase.from_uri(f"mysql+pymysql://{db_config['USER']}@{db_config['HOST']}/{db_name}") db_engine = SQLDatabase.from_uri(f"mysql+pymysql://{ db_config['USER']}:{ db_config['PASSWORD']}@{ db_config['HOST']}/{ db_name}")
-
问题2:ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (13)
-
参考:https://medium.com/@kjavaman12/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock-5ffb8d876af0
-
问题2.1:运行
brew services start mysql
报错-
解决2.1:重装homebrew-service
- 我之前的安装位置是在
opt/homebrew/Library/Taps/homebrew
,可以通过以下方式找到并进入该文件夹下-
运行
rm -rf homebrew-services
完成删除 -
运行
brew tap homebrew/services
完成安装,如下图所示
- 我之前的安装位置是在
-
问题2:此时重新运行
brew install mysql
报错Error: Formulamysql
is not installed.- 解决2:运行
brew install mysql
完成安装
- 解决2:运行
-
-
成功开启本地客户端的mysql服务
- exit 退出
-
服务器启动mysql问题解决
-
问题2.2:服务器端socket默认位置有误,也会报该错
-
解决2.2:运行
mysql --socket=/var/run/mysqld/mysqld.sock -u public -p
-
成功开启服务器的mysql服务
-
-
Mysql数据库情况
mysql> USE DQA_rdb; Database changed mysql> SELECT * FROM DQA_rdb; ERROR 1146 (42S02): Table 'DQA_rdb.DQA_rdb' doesn't exist mysql> SELECT * ; ERROR 1096 (HY000): No tables used mysql> SHOW TABLES; +-------------------+ | Tables_in_DQA_rdb | +-------------------+ | country | | flow | | node_country | | trade_node | +-------------------+ 4 rows in set (0.01 sec) mysql> USE DQA_rdb; Database changed mysql> SHOW TABLES; +-------------------+ | Tables_in_DQA_rdb | +-------------------+ | country | | flow | | node_country | | trade_node | +-------------------+ 4 rows in set (0.00 sec) mysql> SELECT * FROM country; +--------------+---------------------+-------------+ | country_name | home_node | development | +--------------+---------------------+-------------+ | AAC | rheinland | 14 | | ABB | ethiopia | 12.932 | | ABE | chesapeake_bay | 6 | | ABI | mississippi_river | 6 | | ACO | rio_grande | 8 | | ADA | gulf_of_aden | 56.262 | | ADE | gulf_of_aden | 27.491 | | AFG | lahore | 46.435 | | AGG | ohio | 9 | | AGQ | st_lawrence | 9 | | AIR | katsina | 26.964 | | AJU | gulf_of_aden | 34.156 | | AKK | aleppo | 52.378 | | AKT | nippon | 9 | | ALB | ragusa | 10.915 | | ALH | basra | 18.796 | | ALO | ethiopia | 17.394 | | ALS | rheinland | 16 | | ALT | chesapeake_bay | 6 | | AMA | nippon | 8 | | AMG | bordeaux | 25.788 | | ANH | saxony | 6 | | ANL | mississippi_river | 8 | | ANS | rheinland | 8 | | ANT | zanzibar | 11 | | ANU | nippon | 14.892 | | ANZ | basra | 7 | | APA | california | 6 | | ARA | valencia | 196.943 | | ARD | basra | 7 | | ARK | ganges_delta | 20 | | ARL | persia | 9 | | ARN | ohio | 8 | | ARP | james_bay | 6 | | ARW | amazonas_node | 6 | | ASI | james_bay | 6 | | ASK | nippon | 2