问题
I am not sure how to fix this:
dyn-72-33-214-45:python mona$ sudo /usr/local/mysql/bin/mysqld stop
2014-09-06 09:49:04 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-06 09:49:04 22992 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-5.6.15-osx10.7-x86_64/data/ is case insensitive
2014-09-06 09:49:04 22992 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2014-09-06 09:49:04 22992 [ERROR] Aborting
2014-09-06 09:49:04 22992 [Note] Binlog end
2014-09-06 09:49:04 22992 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
回答1:
I'm using OS X (Yosemite) and this error happened to me when I upgraded from Mavericks to Yosemite. It was solved by using this command
sudo /usr/local/mysql/support-files/mysql.server start
回答2:
The MySQL daemon should not be executed as the system user root
which (normally) do not has any restrictions.
According to your cli, I suppose you wanted to execute the initscript instead:
sudo /etc/init.d/mysql stop
Another way would be to use the mysqladmin tool (note, root
is the MySQL root user here, not the system root
user):
/usr/local/mysql/bin/mysqladmin --port=8889 -u root shutdown
回答3:
Try this for Amazon Linux AMI or for centOS
sudo service mysqld restart
回答4:
osx could be using launchctl to launch mysql. Try this:
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
回答5:
Donal had the right solution for me. However, the updated plist
name for 2017 is
com.oracle.oss.mysql.mysqld.plist.
回答6:
On top of @mise's answer, After I installed MacOS Mojave, I also had to change files ownership on all my MAMP directory and contents).
From the Finder, I went in Application/MAMP
, showed files info (cmd
+ i
) and in permissions section added myself with read & write perms, then from the little gear applied to all the children.
回答7:
The correct answer that worked for me on CentOS is
/etc/init.d/mysql restart
which is an init script and not /etc/init.d/mysqld restart, which is binary
The is in fact comment of @MrTux on the question which worked for me. It took quite a bit of my time hence posting it as answer.
回答8:
How i resolved this was following the 4th point in this url: https://dev.mysql.com/doc/refman/8.0/en/changing-mysql-user.html
- Edit my.cnf
- Add
user = root
under under [mysqld] group of the file
If this doesn't work then make sure you have changed the password from default.
回答9:
to run mysqld as root user from command line you need to add the switch/options --user=root
mariadb run as system root user
回答10:
in my case (RHEL7 and MariaDB) this works.
sudo systemctl restart mariadb
来源:https://stackoverflow.com/questions/25700971/fatal-error-please-read-security-section-of-the-manual-to-find-out-how-to-run