启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”

一、Mac OS X的升级或其他原因可能会导致MySQL启动或开机自动运行时

在MySQL操作面板上会提示Warning:The /usr/local/mysql/data directory is not owned by the ‘mysql‘ or ‘_mysql‘ ”,

这应该是某种情况下导致/usr/local/mysql/data的宿主发生了改变,

只需要运行“sudo chown -R mysql /usr/local/mysql/data”即可

mac 下面运行 “sudo chown -R  _mysql:wheel  /usr/local/mysql/data

-------------------------------------------------

    -c 显示更改的部分的信息

    -f 忽略错误信息

    -h 修复符号链接

    -R 处理指定目录以及其子目录下的所有文件

    -v 显示详细的处理信息

-------------------------------------------------

二、what is wheel

    

在Linux中wheel组就类似于一个管理员的组。
通常在LUNIX下,即使我们有系统管理员root的权限,也不推荐用root用户登录。一般情况下用普通用户登录就可以了,在需要root权限执行一些操作时,再su登录成为root用户。但是,任何人只要知道了root的密码,就都可以通过su命令来登录为root用户--这无疑为系统带来了安全隐患。所以,将普通用户加入到wheel组,被加入的这个普通用户就成了管理员组内的用户,但如果不对一些相关的配置文件进行配置,这个管理员组内的用户与普通用户也没什么区别--就像警察下班后,没有带枪、穿这便衣和普通人(用户)一样,虽然他的的确确是警察。
根据应用的实例不同应用wheel组的方法也不同。这里对于服务器来说,我们希望的是剥夺被加入到wheel组用户以外的普通用户通过su命令来登录为root的机会(只有属于wheel组的用户才可以用su登录为root)。这样就进一步增强了系统的安全性。

三、查看用户组

cat /etc/group | grep [group_name]

启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”

时间: 2024-12-24 19:33:11

启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”的相关文章

启动 mysql 失败 Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'

Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' 这应该是某种情况下导致/usr/local/mysql/data的宿主发生了改变. 解决方法:打开终端运行 sudo chown -R mysql /usr/local/mysql/data 即可. mac 下运行  sudo chown -R  _mysql:wheel  /usr/local/mysql/data . -c 显

mysql: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP

Error Symptom: when you run $mysql -u root -p command in the linux you get an error message ” mysql: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: UP” Solution: Step 1: Login as root Step 2: Go to folder path #cd/usr/local/l

mysql 初始化报错 /usr/local/mysql/bin/mysqld:error while loading shared libraries :libaio.so.1

安装mysql在初始化的时候,出现/usr/local/mysql/bin/mysqld:error while loading shared libraries:libaio.so.1 :cannot open shared object file:NO such file or directory 解决方法: <P>type the following</P> <P>apt-get install libaio1 libaio-dev</P> <P

解决MAC下PHP连接MYSQL错误Warning: mysql_connect(): No such file or directory in conn.php

今天在mac上用php去连接mysql数据库,出现了 mac PHP Warning:  mysql_connect(): [2002] No such file... 详细例如以下所看到的: DirkMacBook:vote Dirk$ phpunit MyTest.php  Warning: mysql_connect(): No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/myvote/vote/conn.

启动Memcached报错:/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory

1.查找文件放在哪里 sudo find / -name libevent-2.1.so.6 发现放在/usr/local/lib/libevent-2.1.so.6下. 2.创建软链接 sudo ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib/libevent-2.1.so.6 参考: https://my.oschina.net/itblog/blog/633074

mysql报错--initialize specified but the data directory has files in it. Aborting.

初始化msyql时出现报错 C:\mysql-5.7.19-winx64> C:\mysql-5.7.19-winx64\bin\mysqld --initialize-insecure2019-12-25T01:59:21.234788Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see

MySQL启动时必需到usr/local/mysql目录的问题解决方法

之前我安装MySql数据库的时候,由于我的MySQL不是安装在标准的/usr/local/mysql目录,而是安装在/usr/local/development/mysql-5.5.25目录,导致在启动MySQL服务时报告找不到/usr/local/mysql目录的错误.最后我就创建了符号链/usr/local/mysql链接到/usr/local/development/mysql-5.5.25,解决了服务启动不了的问题. 为什么会出现此问题呢?我们可以打开mysql.server脚本文件,里

mysqld_safe启动报错 mysqld_safe The file /usr/local/mysql/bin/mysqld does not exist or is not executable

报错(如下),但是使用mysqld直接启动没有问题. 150718 00:03:38 mysqld_safe Logging to '/var/log/mysqld.log'. 150718 00:03:38 mysqld_safe The file /usr/local/mysql/bin/mysqld does not exist or is not executable. Please cd to the mysql installation directory and restart t

Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).

? [[email protected] ~]# cd /usr/local/mysql ? [[email protected] mysql]# chown -R mysql.mysql . [[email protected] mysql]# su - mysql [[email protected] ~]$ cd /usr/local/mysql [[email protected] mysql]$ scripts/mysql_install_db ??