24, July 2008

php 4.4.7 and mysql 5.0.x troubles - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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



« on: Jul 18, 2007, 11: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 Visit through proxy

Last blog : MIA - Where Nick and Tim
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7975
40807 credits
Members referred : 3



« Reply #1 on: Jul 18, 2007, 12:51:21 PM »

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 Visit through proxy.

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 Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6280
38506 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jul 18, 2007, 03: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


Last blog : 4th of July Lottery from TemplateMonster.com
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Jul 24, 2008, 09:53:26 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!


Forum Statistics
Total Posts: 35.717
Total Topics: 7.379
Total Members: 3.710
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: prolist

50 Guests, 3 Users online :

10 users online today:



Readers

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