当前位置:网站首页>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!
边栏推荐
猜你喜欢
随机推荐
数据库上机实验7 数据库设计
数据库上机实验6 数据库完整性
NFT:数字所有权的核心
leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
数据库上机实验5 数据库安全性
数字取证autopsy工具用法
利用phpstudy搭建DVWA
C language tutorial (2) - printf and data types that come with c
05 【绑定样式 条件渲染 列表渲染】
Kubernetes certificate validity period modification
初识正则表达式
Sword Point Offer Special Assault Edition ---- Day 1
数据库上机实验4 数据更新和视图
gin框架学习-GORM框架进阶之CRUD接口(数据库增删改查操作)
阿里云中mysql数据库被攻击了,最终数据找回来了
Redis:安装使用
leetcode-每日一题558. 四叉树交集(分治递归)
数据库上机实验1 数据库定义语言
leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
gin框架学习-Casbin进阶之策略管理API使用方法









