mysql常见错误

来源:互联网 发布:javascript贪吃蛇代码 编辑:程序博客网 时间:2024/05/16 08:38

一:启动错误:

STOPPING  server  from  pid  filexxxx.pid  

 mysqld  ended 

查看日志文件:
有下面两句:
InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: Cannot continue operation.
mysqld ended
原来是权限问题:
解决方法:

#> chown -R root .

#> chown -R mysql data

#> chgrp -R mysql

再启动即可。

二:linux环境变量相关知识。

例如执行:mysqldump提示:-bash:command not found

是环境变量设置的问题:

你用env查看环境变量。

PATH=/usr/local/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

没有mysql的。

添加:export PATH=$PATH:/usr/local/mysql/bin(就是你的mysql安装目录下的bin目录)

但是这样添加是临时的,打开一个新的窗口时,这个环境变量已经没了
永久设置:
在该用户的目录下,例如root是/root下面,编辑.bash_profile,添加/usr/local/mysql/bin,
保存退出后执行:source .bash_profile即可。
0 0
原创粉丝点击