2016-03-12T15:40:45.717762Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-03-12T15:40:45.721644Z 0 [Note] mysqld (mysqld 5.7.11) starting as process 10904 ... 2016-03-12T15:40:45.741362Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 2016-03-12T15:40:45.741664Z 0 [ERROR] Aborting 2016-03-12T15:40:45.741726Z 0 [Note] Binlog end 2016-03-12T15:40:45.743453Z 0 [Note] mysqld: Shutdown complete
在虛擬機中安裝了CentOS時安裝了Nami版的Rendmine,沒有設置MySQL自動啟動,手動啟動時出現 Please read "Security" section of the manual to find out how to run mysqld as root!錯誤,根據提示,查了 /opt/redmine-1.2.1-1/mysql/docs/mysql.info的Security部分,發現是因為MySQL為了安全,不希望root用戶直接啟動mysql。下面是文檔中的原文:
*Never run the MySQL server as the Unix `root' user. This is
extremely dangerous, because any user with the `FILE' privilege is
able to cause the server to create files as `root' (for example,
`~root/.bashrc'). To prevent this, *Note `mysqld': mysqld. refuses
to run as `root' unless that is specified explicitly using the
`--user=root' option.
永遠不要使用root帳號啟動MySQL Server。這樣做很微笑,因為擁有FILE'權限的用戶會使得MySQL Server使用root帳戶創建文件(比如,~root/.bashrc),為了防止類似的事情發生,mysqld默認拒絕用戶使用root帳戶啟動,但root用戶可以通過在命令后面加上"--user=root"選項來強行啟動mysqld。
*Note `mysqld': mysqld. can (and should) be run as an ordinary,
unprivileged user instead. You can create a separate Unix account
named `mysql' to make everything even more secure. Use this
account only for administering MySQL. To start *Note `mysqld':
mysqld. as a different Unix user, add a `user' option that
specifies the user name in the `[mysqld]' group of the `my.cnf'
option file where you specify server options. For example:
[mysqld]
user=mysql
與使用root用戶啟動mysqld相比,更好的方法是使用一個普通的、沒有高級權限的用戶帳戶允許mysqld,例如創建一個名為mysql的用戶帳戶來專門管理MySQL。使用其帳啟
動MySQL的方法是在mysqld命令后面加上一個用戶選項,這個用戶屬於mysqld用戶組並且位於my.cnf配置文件中。例如在創建mysql帳戶后,可以將下面的內容添加到my.cnf文
件中:
[mysqld]
user=mysql
This causes the server to start as the designated user whether you
start it manually or by using *Note `mysqld_safe': mysqld-safe. or
*Note `mysql.server': mysql-server. For more details, see *Note
changing-mysql-user::.
這個選項可以使你使用指定的用戶帳戶啟動MySQL,無論是mysqld_safe還是mysql.server命令,都可以使用。
Running *Note `mysqld': mysqld. as a Unix user other than `root'
does not mean that you need to change the `root' user name in the
`user' table. _User names for MySQL accounts have nothing to do
with user names for Unix accounts_.
不要使用Unix的root用戶啟動並不意味着你要修改MySQL中的user表中的root用戶名,因為Unix的root帳戶和MySQL的root帳戶沒有什么關系。
http://www.xuebuyuan.com/762298.html
mysql>FLUSH PRIVILEGES; 加載權限表,讓新密碼生效!