doufei7516 2014-06-15 08:17
浏览 119

Python和PHP使用相同的mySQL数据库

I have a script in Python that retrieves data from a remote server into a MySQL database located on my computer (the one that runs the Python script).

This script is executed daily to retrieve fresh data into the MySQL database. I am using Workbench 6.0 for Windows 64.

I want to add a web GUI to the system that will present some of the data on a web page. I would like to write it in PHP and for my PHP program to use the same MySQL database that my Python script uses. I would like to make it a web server later on so users can log in to the sever and use this web GUI.

Can the PHP and the Python scripts use the same DB?

In the past I have worked with WAMP sever for PHP only. If I install WAMP on the sever, will it be able to use the same DB or can it cause a collision?

  • 写回答

1条回答 默认 最新

  • dongtong5242 2014-06-15 09:36
    关注

    I'd comment, but I don't have enough rep. yet. You should be able to start the Apache and PHP services separately from the WAMP tray icon. If you can't, try this:

    You should be able to use the WAMP menu on the tray icon to open WAMP's my.ini file. In there, just change the port number from 3306 to something else (might as well use 3307) and save the file, then restart WAMP. In the future, completely ignore WAMP's MySQL instance and just use the one that Python is connecting to.

    If that still doesn't work, you might have Skype running. By default, Skype listens on Port 80 for some bizarre reason. Open Skype's settings, go to the "Connection" section and untick "Use port 80 as an alternative for incoming connections." Then try restarting WAMP again.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab求解平差
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?