EnvironmentError: mysql_config not found

EnvironmentError: mysql_config not found

MySQL for Python library在Python中也就相当于JAVA中对应MySQL的JDBC Driver

1. 首先安装mysql

sudo apt-get install mysql-server

 

2. 安装mysql-python

下载MySQL-python-1.2.3.tar.gz(见附件),解压到指定目录。

到解压后的MySQL-python-1.2.3目录下编译配置MySQL-python:

python setup.py build

此时系统报错:EnvironmentError: mysql_config not found

很明显没有mysql_config这个文件

执行find / -name mysql_config,没有任何数据,表明系统中没有mysql_config这个文件

 

 

网上有人解释说使用apt-get安装的MySQL是没有mysql_config这个文件的

解决办法:sudo apt-get install libmysqld-dev

 

此时执行 find / -name mysql_config 在/usr/bin/下发现了这个文件

然后修改MySQL-python-1.2.3目录下的site.cfg文件

去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准)

执行下面命令,此时可以成功编译安装了:

python setup.py build

python setup.py install

[…]

Apache2 won’t load index.php files

I have also noticed that apache won’t even load HTML files from the root (/var/www) directory. As far as I can see. Apache won’t load any page from the root directory. For example when I give to my browser http://localhost/ firefox will display me a dialog asking me to SAVE a PHTML file.

It seems […]

The mysqli extension is missing.

The mysqli extension is missing. Please check your PHP configuration. <a href=”Documentation.html#faqmysql” target=”documentation”><img src=”./themes/pmahomme/img/b_help.png” width=”11″ height=”11″ alt=”Documentation” title=”Documentation” /></a>

 

If you have installed mysql-server then you need to run this command:

sudo apt-get install php5-mysql

and then reload the server.

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

/etc/init.d/mysqld stop mysqld_safe –skip-grant-tables & mysql -u root mysql> use mysql; mysql> update user set password=PASSWORD(“newrootpassword”) where User=’root'; mysql> flush privileges; mysql> quit /etc/init.d/mysqld stop /etc/init.d/mysqld start

使用CPAN模块自动安装perl模块

命令: perl -MCPAN -e shell

初次运行CPAN时需要做一些设置,一路回车在最后选一个最近的CPAN镜像站点。例如国内的中国自由软件库: ftp://freesoft.cgi.gov.cn/pub/languages/perl/CPAN

获得帮助 cpan>h

列出CPAN上所有模块的列表 cpan>m

安装模块

perl -MCPAN -e shell cpan> install IO::Wrap cpan> install Net::Server cpan> install MIME::Words

也可以合并成一条命令,如: perl -MCPAN -e ‘install Net::Server’

退出 cpan>q 如果自动安装失败,可以手动安装跳过测试: cd /root/.cpan/build/Net-Server-0.97/ perl Makefile.PL make install