快速重置MySQL用户密码
1、停止正在运行的MySQL进程
Linux下,运行 killall -TERM mysqld
Windows下,如果写成服务的可以运行:net stop mysql,如未加载为服务,可直接在任务管 理器中进行关闭。
2、以安全模式启动MySQL
Linux下,运行 mysqld_safe --skip-grant-tables &
Windows下,在命令行下运行 X:/MySQL/bin/mysqld-nt.exe --skip-grant-tables
3、完成上述两步以后就可以不用密码进入MySQL了
Linux下,运行 mysql -u root
进入
Windows下,运行 X:/MySQL/bin/mysql -u root 进入
4、更改密码
使用命令修改:
mysqladmin -u root -p password NewPassword
或者使用 sql 直接修改用户信息表:
>use mysql;
>select host, user, password from user;
>update user set password=password("NewPassword") where user="root";
>flush privileges;
注1
: 本人在RED HAT LINUX SERVER 5 上操作MySQL 5.0.77版本成功(LINUX管理员root的密码没忘:)
本文引自:http://www.macophp.com/?action=index&cid=3&page=2
,根据实际情况做了部分修改。
相关文档:
2009年10月30日 星期五 22:53
1, 查看MySQL
服务器配置信息
mysql> show variables;
mysql> show variables;
2, 查看MySQL服务器运行的各种状态值
mysql> show global status;
mysql> show global status;
3, 慢查询
mysql> show variables like '%slow%';
+--------------- ......
1. 使用GRANT语句添加:首先在数据库本机上用ROOT用户
登录MySql(我是用远程控制linux服务器,相当于在服务器本机登录MySql了),然后输入:
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'something' WITH GRANT OPTION;
添加一个用户admin并授权通过本地机(localhost)访问,密码“s ......
这段时间被这个困扰了很久,通过修改配置文件,终于把这个问题解决了。
自己在网上也找了很多关于解决这个问题的方法,但是都讲的不太清楚,所以今天在这重新说下这个问题。
我的解决方法是通过修改mysql的配置文件my.ini,方法如下:
在my.ini中可以发现有这么一段代码:
[client]
port=3306
[mysql]
default ......
Connect MySQL GUI tools to WAMP 2.0
Posted by: Vladislav Sadykov ()
Date: January 24, 2009 09:31AM
Hay, I have a problem with MySQL database.
I have installed WAMP 2.0 server on my Windows machine and now I would like to
connect it with MySQL GUI tools 5.
The problem is that at the startup of ......
报错:
/tmp/ccBBJEB8.o: In function `ping_sql':
pingsql.c:(.text+0x7c): undefined reference to `mysql_init'
pingsql.c:(.text+0xe1): undefined reference to `mysql_real_connect'
pingsql.c:(.text+0xff): undefined reference to `mysql_close'
pingsql.c:(.text+0x119): undefined reference to `mys ......