简体   繁体   English

如何在conda / Python 3.6中使用MySQL

[英]How to use MySQL with conda/Python 3.6

I'm trying to use Python with MySQL, following an online tutorial. 根据在线教程,我尝试将Python与MySQL结合使用。 In the tutorial he installs mysql on Ubuntu, I'm using Windows with Anaconda. 在本教程中,他在Ubuntu上安装mysql,我将Windows与Anaconda结合使用。 I just want start mysql, with the basic command "mysql -u root -p", which I assume is the same on conda. 我只想使用基本命令“ mysql -u root -p”启动mysql,我认为它在conda上是相同的。

I've installed MySQL by downloading it and going through the easy installer (MySQL Workbench works). 我已经通过下载MySQL并通过简单的安装程序安装了它(MySQL Workbench可以运行)。 I've installed "mysqlclient" using pip. 我已经使用pip安装了“ mysqlclient”。 I've installed "pymysql" and "mysql-connector-python" using conda. 我已经使用conda安装了“ pymysql”和“ mysql-connector-python”。

I still am not able to start up mysql through conda. 我仍然无法通过conda启动mysql。 I have some experience with MySQL, am new to Python and Anaconda. 我对MySQL有一定的经验,是Python和Anaconda的新手。

I have Python 3.6 installed, MySQL 5.6, Windows 10. Right now when I try to start mysql through Anaconda (>mysql) it just says "mysql is not recognized..." 我已经安装了Python 3.6,MySQL 5.6,Windows10。现在,当我尝试通过Anaconda(> mysql)启动mysql时,它只是说“无法识别mysql ...”。

I'm assuming I can use Conda just like terminal in Linux to enter MySQL. 我假设我可以像Linux中的终端一样使用Conda进入MySQL。

In this question How to use MySQL with Anaconda's Python IDE someone answered by downloading "pymysql" which I've done. 在这个问题中, 如何通过Anaconda的Python IDE使用MySQL,有人通过下载“ pymysql”回答了我已经完成的问题。 Is there more to it than just installing it? 除了安装之外,还有更多功能吗?

If anyone runs into the same issue. 如果有人遇到同样的问题。 First of all I had to go into Task Manager > Services, and switch mysql to "running". 首先,我必须进入“任务管理器”>“服务”,然后将mysql切换为“ running”。 Then all I had to do was navigate to the mysql folder with conda and was able to start mysql from there. 然后,我要做的就是导航到带有conda的mysql文件夹,并能够从那里启动mysql。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM