How to use MySql In this document you will find a basic explanation about how to activate and use you‟re MySql database. You can only use MySql if you got one of the following packages: Active eCommerce Proffesional Active eCommerce Standaard (add-on required) Active Web and Email Proffesional (add-on required) Active Web and Email start (add-on required) If you‟re currant package doesn‟t meet the requirements you can upgrade you‟re account by using the upgrade function in MyAccount our you can call our email our sales department: Telephone: 0800- 358 4698 Email: [email protected]

Content Activate MySql ........................................................................................................................................................................... 2 PHP MyAdmin............................................................................................................................................................................ 3 How to import a database .......................................................................................................................................................... 4 Encoding in MySQL ................................................................................................................................................................... 7 About character encoding .......................................................................................................................................................... 8 Utf-8 migration (only for developers):......................................................................................................................................... 9 Examples how a webpage can look like after transferring from MySQL 4.0 to MySQL 5.1 with different encoding types. ..... 10

1

Activate MySql Before you can use you‟re MySql database you first have to activate it in you‟re MyAccount. In the advanced mode you will find on the left site the MySql / Create button. Click on Create, then click on create database

You‟re database will now be created. You will get an email with the usernames and passwords if the database is created, this can take up to 2 hours.

2

PHP MyAdmin You can enter the PHP MyAdmin in you‟re MyAccount by pressing the link: “phpMyadmin”

Also you can direct fill in the following URL in you‟re browser: https://mysql5.active24.com/ The following page will be displayed:

Select the preferred language and fill in you‟re Admin username and password that was send to you by mail (technical contact)

3

How to import a database Important note 1 – create and use database “x”: If you have recently created a backup in MySQL version 4 from Active 24/Mamut, make sure that you remove one of the initial lines “CREATE DATABASE „DB1234‟” and “USE DATABASE „DB1234‟”from the database file, since the database already exist before you import to MySQL version 5. If you try to create a database that already exists, it will result in an error.

Important note 2 – database size: Before you import your database check whether your database file is larger than the amount of your purchased database storage (standard 10 MB). In case it is larger, you will have to buy additional database storage in order for your database to work properly. 1.

Click Import on the top bar

4

2. 3. 4.

Locate your database file Choose the correct character set of the file/database to be imported Press Go

5

How to export a database You can export a database clicking the export tab:

Select the tables that you want to export and check the box: save as file, name you‟re export file and press: “ GO”

6

Encoding in MySQL When you upgrade from MySQL 4.0 to MySQL 5.1, you need to make sure you have chosen the right character encoding type. In general, programs use character encoding types to know how to display characters on the screen in a right way. This is used in almost everything, from text editors to displaying text on websites.

MySQL 4.0 can store any encoding type, but there is no easy way of telling which type is stored inside each database. PHP applications need to know which encoding type is used.

In MySQL 5.1 default character set is set to be UTF-8, which means if you are using some other type of encoding it will be very important to choose the same type of encoding when you are about to import your data in MySQL. If you fail to do this correctly, your characters will be displayed wrong and data loss can occur. To be able to choose the right encoding type, you should know a bit more about the different choices.

7

About character encoding Encoding type overview:

1.

ASCII is the first character encoding type, and is compatible with all the next character sets. That is why normal letters like a-z works no matter what encoding type you use. You are not able to choose this option since it only supports a limited number of characters.

2.

Latin1 is an old character encoding limited for Western European languages, Here is a list of supported languages: http://en.wikipedia.org/wiki/ISO/IEC_8859-1

3.

Latin2 is an old character encoding limited for Eastern European languages, Here is a list of supported languages: http://en.wikipedia.org/wiki/ISO/IEC_8859-2

4.

UTF-8 is a recently new variable-length character encoding type which is able to represent any character from any known language.

8

Utf-8 migration (only for developers): If you plan to migrate your entire website to UTF-8 then follow this little step-by step guide: 1.

Convert encoding of MySQL data and all web files with iconv(Linux) or UltraEdit (Windows): http://www.unicodetools.com/

2.

Set encoding type in mysql 5.1 (when importing data in eg. Phpmyadmin)

3.

Set encoding type in the MySQL connection: http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html

4.

Set encoding type In html: http://en.wikipedia.org/wiki/Character_encodings_in_HTML

9

Examples how a webpage can look like after transferring from MySQL 4.0 to MySQL 5.1 with different encoding types. MySQL version 4: Latin-1 to MySQL version 5.1: Latin-1

All characters are displayed correctly.

MySQL version 4: Latin-1 to MySQL version 5.1: UTF-8

10

All characters are not displayed correctly.

MySQL version 4: UTF-8 to MySQL version 5.1: UTF-8

All characters are displayed correctly.

11