How to solve the problem after installing MySQL at 453h

Source: Internet
Author: User
The following articles mainly explain how to solve the garbled problem and installation failure caused by UTF8 database installed at MySQL4.1 or above for H. The following is a description of the specific content of the article, I hope you will understand the actual operations after browsing. I have tried to install mambo4.53h these days, because my database is mysq4.1 or later.

The following articles mainly explain how to solve the garbled problem and installation failure caused by UTF8 database installed at MySQL4.1 or above for H. The following is a description of the specific content of the article, I hope you will understand the actual operations after browsing. I have tried to install mambo 4.53h these days, because my database is mysq4.1 or later.

The following articles mainly explain how to solve the garbled problem and installation failure caused by UTF8 database installed at MySQL4.1 or above for H. The following is a description of the specific content of the article, I hope you will understand the actual operations after browsing.

These days I have tried installing mambo 4.53h, because my database is mysq4.1 or later and the Set character set is UTF8. After several installation attempts, the following situations are found:

1. set the database to latin1 without modifying any files. During installation, the installation can be completed no matter whether gb2312 or utf8 is selected, and the webpage is displayed normally. However, it is found that when you read the data table through phpmyadmin, all Chinese characters in the table are garbled. That is to say, the Chinese webpage can be displayed normally after being saved using the latin1 character set, but Chinese characters are garbled in the database.

You cannot back up the file by using phpmyadmin. No matter what encoding you change to, Chinese characters in the file are garbled characters ). So this is not king, and I did not make a choice.

2. Set the database character set to utf8 without modifying any files. During installation, the error 1071 specified key too long max length 1000 bytes occurs no matter whether gb2312 or utf8 is selected. And as long as the database character set is set to utf8, (utf8 is a character set as 3 bytes storage, latin1 is as 1 bytes storage), No matter according to some comments in the Forum, modify installation/SQL/mambo. SQL or other files may encounter an error where the key exceeds bytes. The installation cannot continue.

I meant to install the Chinese utf8 version of manbo to facilitate integration with other programs. After searching google, forums, and other materials, I tried to use my ideas to select the utf8 Character Set of manbo to be above MySQL4.1, the character set is also installed successfully in the utf8 database.

The webpage displays normal Chinese characters without garbled characters. When you use phpmyadmin to query database tables, all Chinese characters are displayed normally and saved in utf8. The following are my solutions for your reference only:

First, set the database character set to utf8,

 
 
  1. CODE:[Copy to clipboard]ALTER DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

You can also directly change it in phpmyadmin.

Modify the installation/SQL/mambo. SQL file:

Find all

 
 
  1. CODE:[Copy to clipboard]TYPE=MyISAM;

Replace

 
 
  1. CODE:[Copy to clipboard]TYPE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Search

 
 
  1. CODE:[Copy to clipboard]UNIQUE KEY `section_value_value_aro` (`section_value`,`value`)

And

 
 
  1. CODE:[Copy to clipboard]UNIQUE KEY `#__gacl_section_value_value_aro` (`section_value`,`value`),

And comment out or delete the two lines of code with #. whatever ~~

In this Code section

 
 
  1. CODE:[Copy to clipboard]# Table structure for table `#__core_acl_aro_groups`

The following four lines of code are added in sequence:

CODE: [Copy to clipboard] alter table '#__ core_acl_aro 'Chang' section _ value' VARCHAR (240) character set latin1 COLLATE latin1_bin not null default '0 ';

CODE: [Copy to clipboard] alter table '#__ core_acl_aro 'change 'value' value' VARCHAR (240) character set latin1 COLLATE latin1_bin not null default '';

CODE: [Copy to clipboard] alter table '#__ core_acl_aro 'add UNIQUE 'section _ value_value_aro' ('section _ value', 'value ');

CODE: [Copy to clipboard] alter table '#__ core_acl_aro 'add unique' #__ gacl_section_value_value_aro' ('section _ value', 'value ');

Modify the replicdes/database. php file:

Search

 
 
  1. CODE:[Copy to clipboard]$this->_table_prefix = $table_prefix;

Add the following three lines of code under this line:

 
 
  1. CODE: [Copy to clipboard] MySQL (the best combination with PHP) _ query ("set names 'utf8'", $ this-> _ resource );
  2. CODE: [Copy to clipboard] MySQL (the best combination with PHP) _ query ("set character set utf8", $ this-> _ resource );
  3. CODE: [Copy to clipboard] MySQL (the best combination with PHP) _ query ("SET COLLATION_CONNECTION = 'utf8 _ general_ci '", $ this-> _ resource );

Save the modification.

During installation, select UTF8 as the encoding format.

After the modification, the system can be installed normally and the Chinese characters in the database can be displayed and saved normally. If you need to integrate discuz or other programs, you can also select the UTF8 version, after integration, Chinese user names are not used during registration, but garbled characters are displayed after registration.

Notes

After this method is modified, modify the mongodes/database. php when upgrading manbo. Otherwise, an error occurs.

The above modification method is based on several experts in the Forum, some English documents found through google search, and some documents from TW manbo, after the modification is attempted and tested, there is no problem. I hope it will be helpful for friends who encounter the same problem! A useful friend is worthy of the many things I have written.

The above content is an introduction to how to install MySQL for h. I hope you will gain some benefits.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.