python mac下环境配置笔记

我当前的系统:OS X Yosemite 10.10.5

PyCharm激活:http://idea.qinxi1992.cn

配置MySQL遇到的坑:

MySQL-python安装完成后找不到mysql指定解决办法:

$ sudo ln -s /usr/local/mysql/bin/* /usr/bin

然后无法登陆mysql解决步骤:

一:在系统偏好设置停止MySQL服务

二:以管理员身份启动MySQL安全模式

sudo/usr/local/mysql/bin/mysqld_safe--skip-grant-tables

执行结果如下:

2016-06-12T08:29:17.6NZ mysqld_safe Logging to'/usr/local/mysql/data/lyqdeMacBook-Pro.local.err'.2016-06-12T08:29:17.6NZ mysqld_safe Starting mysqld daemon with databasesfrom/usr/local/mysql/data

三:不要关闭该终端,command+n新建一个输入如下命令:

/usr/local/mysql/bin/mysql

看到下面的信息表示登陆成功:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection idis37Server version:5.7.13MySQL Community Server (GPL)

Copyright (c)2000,2016, Oracle and/or its affiliates. All rights reserved.

Oracleisa registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type'help;'or'\h'forhelp. Type'\c'to clear the current input statement.

mysql>

打开"mysql"这个数据库,SQL如下:

mysql>use mysql;

看到结果:

Reading table informationforcompletion of table and column names

You can turn offthisfeature togeta quicker startup with -A

Database changed

mysql>

然后,更新root的密码,SQL如下:

mysql> update usersetauthentication_string=password('root')whereHost='localhost'and User='root';

最后一步:将mysqld_safe进程杀死,重启mysqld

参考:http://www.cnblogs.com/benbenzhu/p/5578162.html

http://www.th7.cn/Program/Python/201411/307030.shtml

你可能感兴趣的:(python mac下环境配置笔记)