28, May 2012

php 4.4.7 and mysql 5.0.x troubles - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: php 4.4.7 and mysql 5.0.x troubles
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: php 4.4.7 and mysql 5.0.x troubles  (Read 1105 times)
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« on: Jul 18, 2007, 10:51:58 am »

Lately I've been coding a new CMS product for my web development clients. As the first client for this product is going to have a site with 8 languages, I thought it would be wise to have a UTF8 encoding system(saves you from a lot of trouble and some people believe it is better for SEO too).

In my development system I have php 4, mysql 4.0 and mysql 5.0. In the server we have php 4, php 5, mysql 4.0 and mysql 5.0. As you may know mysql 4.0.x and smaller versions keep data in ascii format (1 byte per character) while after the 4.1 version they use unicode (2 bytes per character) which give us the ability to have utf8 encoded data. I have never upgraded the mysql from 4.0 as this would cause troubles with our greek applications but now I have to upgrade and use mysql 5.0 for this app.

My problem is that php 4 can't connect to mysql 5.0 (I've tried all possible ways to connect....) I even tried to use custom compiled libraries that didn't worked too. Does anyone here solved this problem somehow, or should I just stick to php 5?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Jul 18, 2007, 11:51:21 am »

Ok after a lot of search I found the problem....

Mysql after 4.1 version changed the way that the passwords are stored. So the new mysql  client uses another password system.

In order to make this work with php, you need php 5+ and use a client library like mysqli or use the libraries that mysql offers.

Now if you want to use php 4 you have to rollback the mysql DBMS. This can be done by this simple query :

Code:
UPDATE mysql.user
SET password=OLD_PASSWORD('somepassword')
WHERE user='someuser'
AND host='somehost';

After the update execution you just restart the server and php 4 will be able to work with mysql 4.1 + Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 18, 2007, 02:09:10 pm »

Smiley never noticed that (maybe because I switched to php5 since a while)

but you're right, it's not wrong to use the mysqli extension.

btw I switched the greek version from some website without any problems from mysql 3 to 4 and finally to 5

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6925
Tags : php mysql upgrade Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: php 4.4.7 and mysql 5.0.x troubles
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:13:07 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.