GA

2012/11/09

MySQL5.6.8でrpmインストール時に変更になったこと

rpmでMySQL-serverをインストールすると、最後に自動でmysql_install_dbが流れるけれど、
mysql_install_dbに--random-passwordsオプションというのが出来て、
rpmでインストールした時にはそのオプションが有効な状態で流れるとのこと。
これによって、rootの初期パスワードが空っぽじゃなくなる。

【2016/03/14 09:22】
MySQL 5.7では更に変わって、mysqld --initializeになっていて.mysql_secretは作らなくなっています。こちらもどうぞ。 http://yoku0825.blogspot.jp/2015/03/mysql-576-mysqlinstalldbmysqld.html

 ⇒/root/.mysql_secretというファイルに書いてあった。
  カレントディレクトリじゃなくてホームディレクトリに作るっぽい。
  中身はこんなの。

# cat /root/.mysql_secret
# The random password set for the root user at Fri Nov  9 10:15:47 2012 (local time): EtZjQcMc

# mysql -pEtZjQcMc
mysql> SELECT user,host,password FROM mysql.user;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
 ⇒mysql.user.password_expiredの値(これも5.6の新機能)が'Y'になってるので、
  先にパスワードを変えないと先に進めない。

mysql> SET PASSWORD = '';
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT user,host,password,password_expired FROM mysql.user;
+------+-----------+-------------------------------------------+------------------+
| user | host      | password                                  | password_expired |
+------+-----------+-------------------------------------------+------------------+
| root | localhost |                                           | N                |
| root | cent24    | *80B1CF9111F7F255A9A5DC45068AFE299FF3CEB3 | Y                |
| root | 127.0.0.1 | *80B1CF9111F7F255A9A5DC45068AFE299FF3CEB3 | Y                |
| root | ::1       | *80B1CF9111F7F255A9A5DC45068AFE299FF3CEB3 | Y                |
+------+-----------+-------------------------------------------+------------------+
4 rows in set (0.00 sec)

確かに無名ユーザーも消えてるし、パスワードはさっきのが設定されてるし、
パスワードはExpireされてる。


5.6がGAになって新しく試した人が、
「rootでログインできません!」
とか路頭に迷う日が来たり?(しないか


【2012/11/09 10:34追記】
mysql_install_dbはついでに、/usr/my.cnf(←が存在すれば/usr/my-new.cnf)を勝手に作ってくれるんだけど、

# cat /usr/my.cnf

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

なんだかなぁ、な内容。。
せめて搭載メモリサイズ拾ってちゃちゃっと値を入れてくれれば良いのに(´・ω・`)

0 件のコメント :

コメントを投稿