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

CentOS MySQL 启动错误

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:56:36
Original
1151 people have browsed it

最近在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

Related labels:
Statement of this Website
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template