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

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

This question is related to mysql sql my.cnf

The answer is


in my case (RHEL7 and MariaDB) this works.

sudo systemctl restart mariadb

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.


Donal had the right solution for me. However, the updated plist name for 2017 is

com.oracle.oss.mysql.mysqld.plist.

I also had the same problem and able to resolve after using below command

/root/mysql-sandboxes/3320/bin/mysqld --defaults-file=/root/mysql-sandboxes/3320/my.cnf  --user=root &

to run mysqld as root user from command line you need to add the switch/options --user=root

mariadb run as system root user


Try this for Amazon Linux AMI or for centOS

sudo service mysqld restart

osx could be using launchctl to launch mysql. Try this:

sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist

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.


you might try this if you logged in with root:

mysqld --user=root

I had this issue while running MySQL on Minikube (Ubuntu box) and I solved it with:

sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld

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.


Very weird, but I got this error when I made a typo in the my.cnf file.
So it had nothing to do with the user directive not defined or not running as root-user.

My mistake was:

bind=192.168.1.2

instead of

bind-address=192.168.1.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

Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to sql

Passing multiple values for same variable in stored procedure SQL permissions for roles Generic XSLT Search and Replace template Access And/Or exclusions Pyspark: Filter dataframe based on multiple conditions Subtracting 1 day from a timestamp date PYODBC--Data source name not found and no default driver specified select rows in sql with latest date for each ID repeated multiple times ALTER TABLE DROP COLUMN failed because one or more objects access this column Create Local SQL Server database

Examples related to my.cnf

Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root MySQL my.cnf performance tuning recommendations MySQL my.cnf file - Found option without preceding group