Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root

148,351

Solution 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

Solution 2

you might try this if you logged in with root:

mysqld --user=root

Solution 3

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

Solution 4

Try this for Amazon Linux AMI or for centOS

sudo service mysqld restart

Solution 5

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

  1. Edit my.cnf
  2. 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.

Share:
148,351
Mona Jalal
Author by

Mona Jalal

contact me at [email protected] I am a 5th-year computer science Ph.D. Candidate at Boston University advised by Professor Vijaya Kolachalama in computer vision as the area of study. Currently, I am working on my proposal exam and thesis on the use of efficient computer vision and deep learning for cancer detection in H&E stained digital pathology images.

Updated on January 04, 2022

Comments

  • Mona Jalal
    Mona Jalal over 2 years

    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
    
  • Mona Jalal
    Mona Jalal over 9 years
    I am using osx ! sudo: /etc/init.d/mysql: command not found
  • MrTux
    MrTux over 9 years
    As you're not using the default port, you have to add your special port to the second command or the socket-path: --socket=/Applications/MAMP/tmp/mysql/mysql.sock
  • yair
    yair over 9 years
    Wow! Thanks a lot! How did you get to this solution, anyway? (Google found you before any docs :) )
  • LarsH
    LarsH about 9 years
    Thank you, this helped me too.
  • SacWebDeveloper
    SacWebDeveloper over 8 years
    While this solution did work to get MySQL running, it doesn't seem like the most correct solution. The MySQL documentation says the files in this directory are for building the server, not for general usage. dev.mysql.com/doc/internals/en/support-files-directory.html
  • Mullefa
    Mullefa over 8 years
    @yair: here is an overview of the different MySQL programs.
  • Pocha
    Pocha over 8 years
    Following this threw a ERROR! The server quit without updating PID file error. I looked into /usr/local/mysql/data/*.err file (the name is as per your username) & it pointed that mysqld aborted as it is unable to connect to /tmp/mysql.sock.lock . I had that file already created (as a different user I guess) & I removed it manually. The command now works.
  • Willa
    Willa about 8 years
    Works like charm! Thanks!
  • Martin
    Martin almost 6 years
    IIR systemctl is generally preferred in CentOS / RHEL
  • skiabox
    skiabox over 5 years
    Awesome answer! I can confirm that this one still works with mac os mojave!