1 Chinese problem, when using MySQL instance configuration tool, set the character set to GBK instead of UTF-8
2. The password cannot be accessed after MySQL is installed:
Mysql> SET PASSWORD
->
'Some _ user' @ 'some _ host'= OLD_PASSWORD ('newpwd ');
3. PHP has Warning
In php. ini, find
Bug_combat_warning = 1. Change 1 to 0.
4. MySQL performs a stronger format check on SQL INSERT. Therefore, if a column is an integer, ''cannot be used for insert. Therefore, a function of Discuz is modified as follows:
Function updatesession (){
If (empty ($ GLOBALS ['sessionupdated']) {
Global $ db, $ sessionexists, $ sessionupdated, $ sid, $ onlineip, $ discuz_uid, $ discuz_user, $ timestamp, $ groupid, $ styleid, $ invisible, $ discuz_action, $ fid, $ tid, $ onlinehold, $ logincredits, $ table_sessions, $ table_members, $ user_lastactivity, $ onlinehold;
If ($ sessionexists = 1 ){
$ Db-> query ("UPDATE $ table_sessions SET uid = '$ discuz_uid', username = '$ discuz_user', groupid = '$ groupid', styleid = '$ styleid ', invisible = '". ($ invisible = ""? 0: 1). "', action =' $ discuz_action ', lastactivity =' $ timestamp ', fid ='". ($ fid = ""? 0: 1). "', tid ='". ($ tid = ""? ). "'Where sid = '$ sid '");
If ($ onlinehold & $ user_lastactivity & $ timestamp-$ user_lastactivity> $ onlinehold ){
$ Db-> query ("UPDATE $ table_members SET lastvisit = lastactivity, lastactivity = $ timestamp WHERE uid = '$ discuz_uid'", 'unbuffered ');
}
} Else {
$ Ips = explode ('.', $ onlineip );
$ Db-> query ("delete from $ table_sessions WHERE sid = '$ sid' OR lastactivity <($ timestamp-$ onlinehold) OR ('$ discuz_uid' <> '0' AND uid = '$ discuz_uid ') OR (uid = '0' AND ip1 = '$ ips [0]' AND ip2 = '$ ips [1]' AND ip3 = '$ ips [2]' AND ip4 = '$ ips [3]' AND lastactivity> $ timestamp-60) ");
$ Db-> query ("insert into $ table_sessions (sid, ip1, ip2, ip3, ip4, uid, username, groupid, styleid, invisible, action, lastactivity, fid, tid)
VALUES ('$ sid', '$ ips [0]', '$ ips [1]', '$ ips [2]', '$ ips [3]', '$ discuz_uid', '$ discuz_user', '$ groupid', '$ styleid ','". ($ invisible = ""? 0: 1). "',' $ discuz_action ',' $ timestamp', '". ($ fid = ""? 0: 1). "','". ($ tid = ""? 0: 1 )."')");
If ($ discuz_uid ){
$ Db-> query ("UPDATE $ table_members SET credit = credit ". intval ($ logincredits ). ", lastip = '$ onlineip', lastvisit = lastactivity, lastactivity = $ timestamp WHERE uid =' $ discuz_uid '", 'unbuffered ');
}
}
$ Sessionupdated = 1;
}
}