Home >Database >Mysql Tutorial >CentOS MySQL 启动错误

CentOS MySQL 启动错误

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:56:361152browse

最近在CentOS下安装了mysql,通过如下命令加入到系统自动启动#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql

最近在CentOS下安装了mysql,,通过如下命令加入到系统自动启动

#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld

#chkconfig --add mysqld

#chkconfig mysqld on

但是在启动时老是不成功,后来查看系统日志文件文件

#less /var/log/mysqld.log

发现系统默认找mysql用户,但是我没有创建这个用户,直接用的root用户创建的,所以出错。

然后创建mysql用户

#groupadd mysql

#useradd -g mysql:mysql

并分配权限

#chown -R root:mysql /usr/local/mysql

重新用mysql用户始化下数据库

#/usr/local/mysql/bin/mysql_install_db --user=mysql

重新启动系统,mysql可自动启动。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn