python踩坑记录,mac端(持续更新)

mysql 部分

# 安装完成之后打开“系统便好设置”,最底下有Mysql,点开,点击启动mysql服务。
# 打开终端

open -e ~/.bash_profile 

# 在打开的记事本文件中滑到最下面加入

export PATH=${PATH}:/usr/local/mysql/bin

# 保存关闭,然后在终端输入

source ~/.bash_profile

# 如果再次打开终端依旧提示找不到mysql 则 打开终端 vi ~/.zshrc 添加 export PATH=${PATH}:/usr/local/mysql/bin 保存后 source ~/.zshrc 即可 # 上面的操作主要是为了加全局命令指向,接着便可以登录mysql了,打开终端输入 mysql
-u root -p # 输入初始密码,就是安装过程中输入的密码 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('新密码'); # 上面这句是基于登录mysql成功后的修改密码 # 有可能会遇到报错:mysql Client does not support authentication protocol requested by server; consider upgrading MySQL # 解决方法 ALTER USER ‘root@localhost’ IDENTIFIED BY ‘123456’ # --------------------------------- # navicat链接报错 Client does not support authentication protocol requested by server; consider upgrading MySQL client # 解决方法: ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码'; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; SELECT plugin FROM mysql.user WHERE User = 'root';

# navicat 插入语句报错 Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

正确:insert into `myDataBase`.`emp` (`ENAME`,`JOB`,`MGR`,`HIREDATE`,`SAL`,`COMM`,`DEPTNO`) VALUES ('mokong','sss','2','2019-10-17 17:23:49','2','2','2');
错误:insert into `myDataBase`.`emp` ('ENAME','JOB','MGR','HIREDATE','SAL','COMM','DEPTNO') VALUES ('mokong','sss','2','2019-10-17 17:23:49','2','2','2');
# 注意前面的列名和数据库数据表包裹的符号是:` 而不是 ' ,在这里卡了挺长时间一直以为是键名顺序或者主键之类的问题。

 

# 您无法在这台电脑上打开“mysql”偏好设置面板。请联系此软件的开发者以获得更高版本。
https://dev.mysql.com/downloads/mysql/

 

 

借鉴部分:【1】【2】【3】

 
posted @ 2019-10-25 10:03  1146937621  阅读(488)  评论(0编辑  收藏  举报