Welcome Guest | Login

Create an utf-8 mysql database - mysql via ssh

Hello
I'd like to create a mysql database wich default encoding would be utf8-general-ci. It seems that cpanel just doesn't permit this: It asks for database name, then create a latin1-swedish-ci database.

Is there a way I can create an utf8 database?

I tried to access mysql via my ssh access, but I just dont know wich username and pass I should give to the "mysql" command

Thanks in advance for your reply.

2007-11-08 08:08 AM

You can login to the mysql server using the following command.

mysql -D <databsename> -u <mysqlusername> -p

Then you can use your particular database using the command use <databsename>; and then type the following command to change the collation of a particular table to utf8_general_ci.

ALTER TABLE <tablename> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Also you can change the default collation of a particular database to utf8_general_ci from your cPanel->phpMyAdmin -->Operations-->Collation section.

2007-11-08 08:58 AM

Thanks for this answer.

2007-11-08 10:22 AM

By the Way: I didn't found the way to have my tables use InnoDB engines by default. I red this could be set up in the mysql.ini, but I have no access to it, and this file is for all databases.

Is there a way for having InnoDB being the default engine for a particular Database? (I mean: a way that if no option is given at the datatable creation, then innoDB is chosen)

2007-11-08 10:58 AM

Hi  -   I am not sure if there is an option to make the default engine as InnoDB for a user on the server. You can use the file named .my.cnf in your home directory instead of my.ini to set user-specific options. Thanks you

2007-11-08 12:55 PM

HostingRails Support

Hello Guest! In order to post you must be an active client with us, please log in or sign up.