MySQL for Python Library in Python is equivalent to the jdbc driver corresponding to MySQL in Java
1. Install MySQL first
sudo apt-get install mysql-server
2. Install MySQL Python
Download mysql-python-1.2.3.tar.gz (see the attachment) and unzip it to the specified directory.
Compile and configure MySQL Python in the decompressed mysql-python-1.2.3 directory
python setup.py build
At this time, the system reports an error: environmenterror: MySQL_ config not found
Obviously there is no mysql_ Configure this file
Execute find/- name MySQL_ Config, there is no data, indicating that there is no MySQL in the system_ Configure this file
Someone on the Internet explained that MySQL installed with apt get does not have mysql_ Config is the name of this file
Solution:
(1) Ubuntu next
Execute sudo apt get install libmysqld dev
(2) Fedora next
Execute sudo Yum install Python devel
If it appears: my_ Config. H: without that file or directory, execute: sudo Yum install MySQL devel
Note: Yum is also written in Python, and/usr/bin/Python is called by default. This is the python that comes with the system itself. You can install it in/usr/local/bin/python, so you’d better not uninstall the python that comes with the system. The python you download doesn’t have the yum module.
Execute at this time find/-name mysql_ Config found this file under/usr/bin /
Then modify the site.cfg file in the mysql-python-1.2.3 directory
Remove MySQL_ Config = XXX and change to MySQL_ config=/usr/bin/mysql_ Config (in MySQL)_ The directory on the machine where the config file is located shall prevail.)
Execute the following command to compile and install successfully:
python setup.py build
python setup.py install
http://zhoujianghai.iteye.com/blog/1520666
Read More:
- The MAC system installs MySQL client, and the error is solved_ config not found
- Error: pg_config executable not found.
- Error: could not install packages due to an environmenterror: [winerror 5] access denied.
- MySQL server PID file could not be found!
- Vue error: no postcss config found solution
- cnpm error Module build failed: Error: No PostCSS Config found in:
- Module not found error: the solution to the problem of no module named ‘MySQL’
- IntelliJ idea error: package not found or symbol not found
- Mysql Error:The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist
- How to Fix Pandoc wasn’t found.pdflatex not found on PATH
- MySQL: if the remote connection using navicatip fails, prompt “is not allowed to connect to this MySQL server”
- MySQL uses net start MySQL startup prompt (failed to start, the service did not report any error)
- Spring cloud config does not read bootstrap.properties/yml
- [Solved] ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error
- ERROR Invalid options in vue.config.js: “plugins“ is not allowed
- [solved] – bash: rabbitmq plugins: command not found or RA bbitmqctl:command not found
- MySQL error set: failed to start mysql.service : Unit mysql.service is masked.
- Error c3861: identifier not found | identifier not found
- Error in installing MySQL devel for CentOS MySQL
- The MySQL service suddenly hangs up with the error message can’t connect to MySQL server on ‘localhost’ (10061)