1. brew install mysql

2. 启动mysql mysql.server start

我遇到了这个error,查openstack解决,我在这粘一下

### Error:Can't connect to local MySQL server through socket homebrew

When you got the server running via

mysql.server start

you should see the socket in /tmp/mysql.sock. However, the system seems to expect it in /var/mysql/mysql.sock. To fix this, you have to create a symlink in /var/mysql:

sudo mkdir /var/mysql

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

3. 配置密码等 mysql_secure_installation

4. 如果忘记密码,简单点,删除再装可以吧

删除

  • sudo rm /usr/local/mysql

其实这一句就够了,以防万一,所有可能的地删除一遍

  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*
  • sudo rm -rf /private/var/db/receipts/*mysql*

5.  安装mysql-python

pip install mysql-python

遇到两个error

1)“config.h” not  found

解决办法:

  brew install mysql-connector-c

  

CFLAGS=-Qunused-arguments CPPFLAGS=-Qunused-arguments pip install MySQL-python==1.2.5

2)“pip install mysql-python“   fails with  ’IndexError‘

By finding out the information that mysql-connector-cmight come to the conclusion that the configuration by brew installation may be incorrect , open the /usr/local/bin/mysql_config script to modify some of the contents of it:

#Create options
Libs = "-L $ pkglibdir "
Libs = " $ libs -l"

change into:

#Create options
Libs = "- L $ pkglibdir"
Libs = "$ libs -lmysqlclient -lssl -lcrypto"

 

最新文章

  1. PHP的数组排序函数
  2. Leetcode-463 Island Perimeter
  3. 关于Onvif的event
  4. Windows Server 2008 R2 备份和恢复 (转)
  5. Spring的profile属性
  6. jquery rotate
  7. ASPxCallback控件
  8. Github的使用以及Git的简单入门 - 课程作业三
  9. C语言的几个有趣问题
  10. POJ 1077 Eight
  11. flappy pig小游戏源码分析(3)——解剖util
  12. leetcode面试准备: Substring with Concatenation of All Words
  13. 安卓使用Dialog创建普通对话框
  14. Hbase写数据,存数据,读数据的详细过程
  15. sql存储过程——名称 ****不是有效的标识符
  16. redhat Redis的安装和部署
  17. 201521123084 《Java程序设计》第12周学习总结
  18. [ZJOI2006]超级麻将
  19. C# WinForm 技巧十: winfrom 全屏自适应屏幕分辨率
  20. 常用User-Agent大全

热门文章

  1. [ZJOI2011]看电影(组合数学/打表+高精)
  2. SSM项目启动报错:Failed to read candidate component class
  3. 网络数据包最大长度 MTU 分片 转发https://blog.csdn.net/singular2611/article/details/52513406
  4. Codeforcs 1183B Equalize Prices
  5. 力扣算法题—111.Minimum Depth of Binary Tree
  6. pandas读取文件出现路径不存在的问题
  7. divide方法
  8. vue中wath的源码实现
  9. 借用数组对象的prototype给数组扩充降维方法
  10. BCZM: Chapter 2