Please read “Security” section of the manual to find out how to run mysqld as root!错误解决(转)

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: 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.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; 加载权限表,让新密码生效!

 

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
关系型数据库 MySQL Unix
mysqld_safe: command not found 解决方法
mysqld_safe: command not found 解决方法
1313 0
|
MySQL 关系型数据库 Shell
Unit mysql.service failed to load: No such file or directory的解决办法
Failed to issue method call: Unit mysql.service failed to load: No such file or directory的解决办法 1、软件环境: OpenSUSE 13.
3241 0