> sudo rpm -ivh MySQL-server-standard-5.0.18-0.sles9.i586.rpm Password: 警告: MySQL-server-standard-5.0.18-0.sles9.i586.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Preparing... ########################################### [100%] 1:MySQL-server-standard ########################################### [100%] PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h grape password 'new-password' See the manual for more instructions. Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com Starting MySQL done
> sudo rpm -ivh MySQL-client-standard-5.0.18-0.sles9.i586.rpm 警告: MySQL-client-standard-5.0.18-0.sles9.i586.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 Preparing... ########################################### [100%] 1:MySQL-client-standard ########################################### [100%] >
grape:/usr/share/mysql/japanese # mv errmsg.sys _errmsg.sys grape:/usr/share/mysql/japanese # cat _errmsg.sys | nkf -Ew > errmsg.sys
変数 | ディレクトリ | 説明 |
basedir | / | |
bindir | /bin/dir | MySQLのインストールディレクトリ |
datadir | /var/lib/mysql | データベースファイルの格納場所 |
> sudo cp /usr/share/mysql/my-large.cnf /etc/my.cnf
24 # The MySQL server 25 [mysqld] … 120 121 # Uncomment the following if you are using InnoDB tables 122 innodb_data_home_dir = /var/lib/mysql/ 123 innodb_data_file_path = ibdata1:1024M:autoextend 124 innodb_log_group_home_dir = /var/lib/mysql/ 125 innodb_log_arch_dir = /var/lib/mysql/ 126 # You can set .._buffer_pool_size up to 50 - 80 % 127 # of RAM but beware of setting memory usage too high 128 innodb_buffer_pool_size = 256M 129 innodb_additional_mem_pool_size = 20M 130 # Set .._log_file_size to 25 % of buffer pool size 131 innodb_log_file_size = 64M 132 innodb_log_buffer_size = 8M 133 innodb_flush_log_at_trx_commit = 1 134 innodb_lock_wait_timeout = 50 135 136 # Add by Hondoh 137 character-set-server=utf8 138 character-sets-dir=/usr/share/mysql/japanese 139 default-table-type=InnoDB 140 skip-character-set-client-handshake
# rm /var/lib/mysql/ib_logfile* # rm /var/lib/mysql/ibdata* # /etc/init.d/mysql restart
# /usr/bin/mysqladmin -u root password '************'
> mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 to server version: 5.0.19-standard-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql; Database changed mysql> select host,user,password from user; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | ***************************************** | | grape | root | | | grape | | | | localhost | | | +-----------+------+-------------------------------------------+ 4 rows in set (0.00 sec) mysql> delete from user where user=''; Query OK, 2 rows affected (0.02 sec) mysql> delete from user where host='grape' and user='root'; Query OK, 1 row affected (0.00 sec) mysql> select host,user,password from user; +-----------+------+-------------------------------------------+ | host | user | password | +-----------+------+-------------------------------------------+ | localhost | root | ***************************************** | +-----------+------+-------------------------------------------+ 1 row in set (0.00 sec)
mysql> delete from db where user=''; Query OK, 2 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
# mysql -u root -p Enter password:************ Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.18-standard-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use test; Database changed mysql> show tables; Empty set (0.00 sec) mysql> create table books ( -> isbn int, -> title varchar(50), -> author varchar(50) -> ); Query OK, 0 rows affected (0.01 sec) mysql> show tables; +----------------+ | Tables_in_test | +----------------+ | books | +----------------+ 1 row in set (0.00 sec) mysql> insert into books(isbn,title,author) values('1','現代雑兵物語','軍曹'); Query OK, 1 row affected (0.01 sec) mysql> select * from books; +------+--------------------+--------+ | isbn | title | author | +------+--------------------+--------+ | 1 | 現代雑兵物語 | 軍曹 | +------+--------------------+--------+ 1 row in set (0.00 sec) mysql> drop table books; Query OK, 0 rows affected (0.00 sec)
きちんと日本語も通るようです。