当前位置:网站首页>Install mysqldb in mac10.14
Install mysqldb in mac10.14
2022-07-31 05:47:00 【ham programming】
Content
Install mysqldb in python2.7. As the mysql version increases, the libmysqlclient.dylib version will also increase. If it is mysql version 5.7, the corresponding version should be libmysqlclient.18.dylib, so you must readclear!My mysql version is 8.0.12, so the corresponding libmysqlclient version is 21. When I download it, use the command to download mysqldb, as follows:
1. Install the mysql version, the installation tutorial address: Mac installation mysql detailed tutorial
2.sudo install mysqldb
Then enter the python environment to import mysqldb, appear:
As can be seen from the reported problem, trying to load the libmysqlclient packageBut it was not found from this path, so there are several solutions, configure environment variables, and establish symbolic links. The editor uses the second solution.
Actually I found that the library is located in my downloaded mysql path: /usr/local/mysql/lib, I should now make the search path change to my this library.The default lookup library for mysqldb is /usr/local/lib
3.bash-3.2$ sudo ln -s /usr/local/mysql/lib/libmysqlclient.21.dylib /usr/local/lib/libmysqlclient.21. dylib
After repeating the above import mysqldb, the following situation occurs:
Even if it is normal!
Summary:
Don't panic when you encounter problems, you must do some analysis yourself first!
边栏推荐
猜你喜欢
leetcode-每日一题558. 四叉树交集(分治递归)
数字取证autopsy工具用法
局部变量成员变量、引用类型、this,static(第五天)
gin框架学习-Casbin入门指南(ACL、RBAC、域内RBAC模型)
元宇宙的前景及四大赛道
为什么redis是单线程还那么快?
代码块、Package,Import,封装(第六天)
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
【ubuntu20.04安装MySQL以及MySQL-workbench可视化工具】
剑指offer基础版 --- 第22天
随机推荐
Regular Expression Basics
代码执行漏洞
小白学爬虫——爬虫入门
解决响应式数据依赖响应式数据无响应问题
uni-app进阶之自定义【day13】
vulhub靶场学习日记xxe-lab
10 【组件编码流程 组件自定义事件 全局事件总线】
剑指offer基础版 ---- 第29天
什么是 GameFi?
leetcode-438. 找到字符串中所有字母异位词(滑动窗口)
剑指offer基础版--- 第23天
Anaconda configure environment directives
剑指offer专项突击版 ---- 第1天
数据库上机实验3 连接查询和分组查询
13 【代理配置 插槽】
Detailed explanation of pointers in C language
三子棋讲解(C语言)
NFT与数字藏品到底有何区别?
“档次法”——用于物品体积分布不均匀的01背包问题的求解方法
Quickly master concurrent programming --- the basics