MyBB Community Forums

Full Version: [D] Bug with mysql version older than 4.1.0?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I try to install the MyBB (1.4.4/1.4.3) on my server with mysql 4.0.27. During installation, there is a error after input the database info because of the SQL-Query: 'SET NAMES ... '.

Fixed this error is much easier, just need add three lines code in inc/db_mysql.php as below:

*** mybb_orig/inc/db_mysql.php  Mon Nov 17 16:41:35 2008
--- mybb/inc/db_mysql.php       Mon Nov  3 16:27:26 2008
***************
*** 226,231 ****
--- 226,237 ----
                else if(!$this->write_link)
                {
                        $this->error("[WRITE] Unable to connect to MySQL server");
+               }
+ 
+               // Skip the charset encoding for Lower than 4.1.0
+               if (version_compare('4.1.0', mysql_get_server_info($this->read_link)) > 0)
+               {
+                       $this->db_encoding = '';
                }
  
                // Select databases
From the Wiki:

Quote:MySQL version 4.0 or above, PostgreSQL, or SQLite

So it 'should' work but 4.0.27 seems to be a very early version so may not work.
This was fixed in MyBB 1.4.4. You need to comment the $config['db_encoding'] line in your inc/config.php