解决 MySQL

Jun 07, 2016 pm 03:40 PM
mysql windows Install environment solve

在 windows 环境安装 MySQL-python-1.2.3b1 遇到错误 ------------ C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python-1.2.3b1 setup.py Traceback (most recent call last): File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-

在 windows 环境安装 MySQL-python-1.2.3b1 遇到错误

------------

C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python-1.2.3b1
>setup.py
Traceback (most recent call last):
  File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python
-1.2.3b1/setup.py", line 15, in
    metadata, options = get_config()
  File "C:/TDDOWNLOAD/MySQL-python-1.2.3b1.tar/MySQL-python-1.2.3b1/MySQL-python
-1.2.3b1/setup_windows.py", line 7, in get_config
    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_ke
y'])
WindowsError: [Error 2]

------------ 

WindowsError: [Error 2]

系统找不到指定的文件。

------------ 

google一时没找到说明,找到的两个相关内容也是俄语的,那就看看代码好了: 

 

file "setup_windows.py", line 7, in get_config

metadata, options = get_metadata_and_options()

serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')

 

file "setup_common.py" line 5,8, in get_metadata_and_options

config.read(['metadata.cfg', 'site.cfg'])

options = dict(config.items('options'))

 

file "site.cfg" line 18 in [options]

registry_key = SOFTWARE/MySQL AB/MySQL Server 5.0

 

很明显,是要找到下面注册表项

HKEY_LOCAL_MACHINE/SOFTWARE/MySQL AB/MySQL Server 5.0

的 Location 键值,而这个键值取出来后就用在后面代码,用来设置 mysql

的 include 目录与 library 目录

 

file "setup_windows.py", line 19,21, in get_config

library_dirs = [ os.path.join(mysql_root, r'lib/opt') ]
include_dirs = [ os.path.join(mysql_root, r'include') ]

 

而我机器上的两个mysql一个是 XAMPP 带的,另一个是 mysql-noinstall-5.0.67-win32 都没有写

注册表相应键值。搞清楚了情况,要解决问题就很简单了 

  

然后

setup.py build

setup.py install 

测试OK

 

----------------

MySQL for Python

http://sourceforge.net/projects/mysql-python 

MySQL for Python 1.2.3b1 release.

http://sourceforge.net/project/showfiles.php?group_id=22307&package_id=34790&release_id=658932

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to start mysql by docker How to start mysql by docker Apr 15, 2025 pm 12:09 PM

The process of starting MySQL in Docker consists of the following steps: Pull the MySQL image to create and start the container, set the root user password, and map the port verification connection Create the database and the user grants all permissions to the database

Centos install mysql Centos install mysql Apr 14, 2025 pm 08:09 PM

Installing MySQL on CentOS involves the following steps: Adding the appropriate MySQL yum source. Execute the yum install mysql-server command to install the MySQL server. Use the mysql_secure_installation command to make security settings, such as setting the root user password. Customize the MySQL configuration file as needed. Tune MySQL parameters and optimize databases for performance.

Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

How to install mysql in centos7 How to install mysql in centos7 Apr 14, 2025 pm 08:30 PM

The key to installing MySQL elegantly is to add the official MySQL repository. The specific steps are as follows: Download the MySQL official GPG key to prevent phishing attacks. Add MySQL repository file: rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm Update yum repository cache: yum update installation MySQL: yum install mysql-server startup MySQL service: systemctl start mysqld set up booting

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

See all articles