Please read "Security" section of the manual to find out how to run mysqld as root!错误解决
2017-02-14 00:00
696 查看
环境: CentOS
MySQL版本:5.6.30
开发环境:jdk8,spring+MyBatis+jta
报错原因:做添加Date类型操作是,出现时区问题,导致存入数据库的时间与当北京时间相差8小时,后来采用网上解决方法:
以管理员身份登陆mysql 执行以下语句
mysql > SET time_zone = '+8:00'; # 此为北京时,我们所在东8区
mysql> flush privileges; # 立即生效
在重启mysql时,启动失败,错误信息为pid未找到。
---------------------------------------------------------------------------解决方法:
在虚拟机中安装了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帐户没有什么关系。
MySQL版本:5.6.30
开发环境:jdk8,spring+MyBatis+jta
报错原因:做添加Date类型操作是,出现时区问题,导致存入数据库的时间与当北京时间相差8小时,后来采用网上解决方法:
以管理员身份登陆mysql 执行以下语句
mysql > SET time_zone = '+8:00'; # 此为北京时,我们所在东8区
mysql> flush privileges; # 立即生效
在重启mysql时,启动失败,错误信息为pid未找到。
---------------------------------------------------------------------------解决方法:
在虚拟机中安装了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帐户没有什么关系。
相关文章推荐
- Please read "Security" section of the manual to find out how to run mysqld as root!错误解决
- Please read "Security" section of the manual to find out how to run mysqld as root!错误解决
- Please read “Security” section of the manual to find out how to run mysqld as root!错误解决(转)
- mysql多实例配置下,用脚本启动mysql时,出现Please read "Security" section of the manual to find out how to run mysqld as root!
- [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
- [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as r
- 解决错误:unable to find a version of the runtime to run this application
- Mac环境下mysql初始化密码问题--If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
- 如何解决sql server2005的“不允许远程连接”错误.(how to resolve the error: "SQL Server does not allow remote connections" for SQL Server2005)
- unable to find the wrapper "https"错误解决办法
- Unable to find a version of the runtime to run this application解决方法
- How to fix the dreaded "java.lang.OutOfMemoryError: PermGen space" exception (classloader leaks)
- The stack 'CSTACK' is filled to 100% (4096 bytes used out of 4096) 错误解决
- hadoop格式化报错:"May not run daemons as root. Please specify HADOOP_NAMENODE_USER"的解决办法
- How to fix the dreaded "java.lang.OutOfMemoryError: PermGen space" exception (classloader leaks)
- Unable to find the wrapper "https"错误的解决办法
- AsParallel \AsQueryable<T>().ToList() [System.ArgumentOutOfRangeException was unhandled" 索引超出范围。必须为非负值并小于集合大小]解决方法
- 关于 运行root.sh 时出错误Timed out waiting for the CRS stack to start.的解决
- tesseract-ocr 出现 错误 Please make sure the TESSDATA_PREFIX environment variable is set to the parent d irectory of your "tessdata" directory.解决方案
- How To Fix Xcode's "used as the name of&