linux下 mysql 忘记root用户密码解决办法
linux下忘记了mysql的root用户密码解决办法:
一、以系统的root用户(什么,你的系统的root用户密码也忘了。那只好看我另外一篇linux下忘记root用户的解决办法了先解决这个问题)登陆系统,进入终端
[root@localhost /]#
二、杀掉mysql进程
方法1、[root@localhost /]#killall mysqld
方法2、[root@localhost /]#ps -aux //查看所有进程,找到mysql进程的pid
然后
[root@localhost /]#kill pid //pid是mysql的进程号
三、用--skip-grant-tables参数启动mysqld
[root@localhost /]#/usr/local/mysql/bin/mysqld_safe --skip-grant-tables&
// 其中/usr..../bin是我的mysql安装目录
[root@localhost /]#/usr/local/mysql/bin/mysql //进入mysql
mysql> use mysql //切换到mysql database
mysql> UPDATE user SET password=password('123456') WHERE user='root';
//将root密码该为123456了
四、注意事项
The full command to load MySQL like this is:
mysqld_safe --skip-grant-tables --autoclose
(Editor's Note: Our technical reviewer found that he had to launch the mysqld_safe command
without the '--autoclose' flag, otherwise the daemon never started.)
这是国外网站说的,我没用autoclosa也成功了
但是我在执行/usr/local/mysql/bin/mysqld_safe --skip-grant-tables&即出现错误提示:
./mysqld_safe
starting mysqld daemon with databases from /usr/local/var
STOPPING server from pid file /usr/local/var/localhost.localdomain.pid
mysqld ended
然后进入/usr/local/var/
vi ./localhost.localdomain.err 内容如下:
050410 04:02:59 mysqld started
050410 4:03:00 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:File name ./ibdata1
InnoDB:File operation call:'create'.
InnoDB:Cannot continue operation.
050410 04:03:00 mysqld ended
怀疑是./var目录的访问权限,故如下操作:
chmod 777 ./var
相关文档:
日期:2007-01-23 作者:Linux时代 来自:linux.chinaunix.net
一、引言
想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的MySQL。本以为有
Windows下使用SQL
Server的经验,觉得在Linux下安装MySql应该是易如反掌的事,可在真正安装和使用MySQL时 ......
linux进程调度方法(SCHED_OTHER,SCHED_FIFO,SCHED_RR)
linux内核的三种调度方法:
1,SCHED_OTHER 分时调度策略,
2,SCHED_FIFO实时调度策略,先到先服务
3,SCHED_RR实时调度策略,时间片轮转
linux内核的三种调度方法:
1,SCHED_OTHER 分时调度策略,
2,SCHED_FIFO实时调度策略,先到先服务
3,SCHED_RR实时 ......
MD5算法常常被用来验证网络文件传输的完整性,防止文件被人篡改。MD5 全称是报文摘要算法(Message-Digest Algorithm 5),此算法对任意长度的信息逐位进行计算,产生一个二进制长度为128位(十六进制长度就是32位)的“指纹”(或称“报文摘要”),不同的文件产生相同的报文摘要的可能性是非常非常之 ......
linux目录架构
/ 根目录
/bin 常用的命令 binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心 (kernel) 在内
/boot/grub/menu.lst &n ......
随着Linux应用的扩展许多朋友开始接触Linux,根据学习Windwos的经验往往有一些茫然的感觉:不知从何处开始学起。这里介绍学习Linux的一些建议。
一、从基础开始:常常有些朋友在Linux论坛问一些问题,不过,其中大多数的问题都是很基础的。例如:为什么我使用一个命令的时候,系统告诉我找不到该目录,我要如何限制使用者 ......