Index: lams_documents/lams_common/MySQL 4.1 Setup for UTF-8.txt =================================================================== diff -u -rf9b7da5764b69d7e8e81b035121a57a882679139 -r4cd46a271ad29afcfb38b263d1bcdf6450806612 --- lams_documents/lams_common/MySQL 4.1 Setup for UTF-8.txt (.../MySQL 4.1 Setup for UTF-8.txt) (revision f9b7da5764b69d7e8e81b035121a57a882679139) +++ lams_documents/lams_common/MySQL 4.1 Setup for UTF-8.txt (.../MySQL 4.1 Setup for UTF-8.txt) (revision 4cd46a271ad29afcfb38b263d1bcdf6450806612) @@ -1,17 +1,31 @@ +For using UTF-8, you MUST use MySQL 4.1 + # ============= +# General +# ============= +You can specify a character set for the server, +database, table, column, or client connection. + +This makes the setting up the database a bit complicated. + +@see http://dev.mysql.com/doc/mysql/en/charset-defaults.html + +# ============= # Windows version # ============= * Windows version of MySQL 4.1 now comes with 3 installation packages. * If you used Windows-installer versions, they ask about the language setting. Choose the "most internatioanl" option, which uses UTF-8. +* In addition you MUST create your database with + +CREATE DATABASE lams DEFAULT CHARACTER SET utf8 + * You should use the standard installation version (not the "essentail" version) for development, since it installs the bebug codes in case you need it. -* Then, create the lams database as the Chris' instruction below. - * my.ini or my.conf used to be located in C:\ but now it is located where your copy of MySQL is installed (typically C:\Program Files\MySQL\MySQL Server 4.1). @@ -20,15 +34,30 @@ as a Service (which you should not for a development environment). Add the line in the my.ini as Chris' instruction to change the default transaction isolation level. + +* You must also connect with a correct character set. # ============= # Linux/Solaris version # ============= * my.conf file is located at /etc/my.conf +* set the database language to use UTF-8 in my.conf + +[mysqld] +default-character-set=UTF-8 +[mysqldump] +default-character-set=UTF-8 +[mysql] +default-character-set=UTF-8 + * If it does not exist, you have to create one by -* copying a sample config file included in the MySQL + copying a sample config file included in the MySQL home directory +* Create lams database with utf8 as default + +* Send cleint connection request with specifying utf8 + # ============= # Securing the initial database # ============= @@ -41,8 +70,51 @@ * Also, delete the anonymous user (user=' ' and password is ' '); delete from user where user=' '; - +# ============= +# creating LAMS database and setting up the lams user with password +# ============= +#----------------------------------------------------------------------- +# Example MySQL script +# Replace 'melcoe006' and '192.168.111.106' with appropriate addresses +# Replace 'lamsdemo' with appropriate password +#----------------------------------------------------------------------- + +CREATE DATABASE IF NOT EXISTS lams DEFAULT CHARACTER SET utf8; + +USE mysql; + +DELETE FROM user WHERE user=''; +DELETE FROM db WHERE user=''; + +GRANT ALL PRIVILEGES ON *.* TO lams@localhost IDENTIFIED BY 'lamsdemo'; +REVOKE PROCESS,SUPER ON *.* FROM lams@localhost; + +# The host name of the machine on which MYSQL resides +GRANT ALL PRIVILEGES ON *.* TO lams@'melcoe006' IDENTIFIED BY 'lamsdemo'; +REVOKE PROCESS,SUPER ON *.* FROM lams@'melcoe006'; + +# This is for two server configuration (JBoss and MySQL on different servers) +# The internal IP address of the JBoss machine that connects to the MySql database +#GRANT ALL PRIVILEGES ON *.* TO lams@'192.168.111.106' IDENTIFIED BY 'lamsdemo'; +#REVOKE PROCESS,SUPER ON *.* FROM lams@'192.168.111.106'; + +# This may be a security risk (do it only if you needed this to make MySQL work) +GRANT ALL PRIVILEGES ON *.* TO lams@'%' IDENTIFIED BY 'lamsdemo'; +REVOKE PROCESS,SUPER ON *.* FROM lams@'%'; + +FLUSH PRIVILEGES; + +GRANT ALL PRIVILEGES ON lams.* TO lams@localhost IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON lams.* TO lams@'melcoe006' IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON lams.* TO lams@'192.168.111.106' IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON lams.* TO lams@'%' IDENTIFIED BY 'lamsdemo' WITH GRANT OPTION; + +FLUSH PRIVILEGES; +#------- end ----------------------------------------------------------- + + + From: Chris Perfect [chris@e-plus.com.au] Sent: Tuesday, 8 February 2005 4:04 PM To: LAMS Dev