Wednesday, May 26, 2010

MySQL Load Problem Workaround on Ubuntu Server

Although I could say that using Ubuntu Server is easy, but apparently not all the setting-up things run well :)) Recently I've got problem with my MySQL Load. My web pages cannot connect to MySQL Server, but checking to connect from terminal don't have trouble at all.

After doing some googling, mine is working now. It seems that mysql 5.0 needs php5-mysqli rather than php5-mysql. Basically it involved editing the 'extension_dir' property in my php.ini file:
$ sudo vi /etc/php5/apache2/php.ini
for the 'extension_dir' property change /usr/lib/php5/20060613 to '/usr/lib/php5/ext' and save the file.

Now you have to create the directory:
$ sudo mkdir /usr/lib/php5/ext

And now copy your mysql.so file to this new directory under the new name mysqli.so:
$ sudo cp /usr/lib/php5/20060613/mysql.so /usr/lib/php5/ext/mysqli.so

Then restart Apache:
$ sudo /usr/sbin/apache2ctl restart

No comments:

Post a Comment

Hi, for all of those who already put comments on my blog post, thanks.. really appreciate it. And for those who have not, just put your comments here :)