|
HTTP,MySQL,Apache,PHP,SEO,google,百度,FTP,Linux,域名注册,Server,免费软件,知识产权,中国搜索,爬虫,搜索引擎,FTP Jail,vsFTPD,qihoobot,BadBot,Ports,Network,Remove Pass-phase,SSL,Installation,缓存,Cache,Proftpd,Index,新闻组
| 阅读上一个主题 :: 阅读下一个主题 |
| 留言 |
|
What If You Forget Mysql Root Password
|
|
| |
|
发布人: Mrs LA
发布于: 2007/11/29, 9:40 pm
|
|
|
If you have set a root password, but forgot what it was, you can set a new password with the following procedure:
1. Take down the mysqld server by sending a kill (not kill-9) to the mysqld server. The pid is stored in a `.pid' file, which is normally in the MySQL database directory:
shell> kill `cat /mysql-data-directory/hostname.pid`
You must be either the Unix root user or the same user mysqld runs as to do this.
2. Restart mysqld with the --skip-grant-tables option.
3. Set a new password with the mysqladmin password command:
shell> mysqladmin -u root password 'mynewpassword'
4. Now you can either stop mysqld and restart it normally, or just load the privilege tables with:
shell> mysqladmin -h hostname flush-privileges
5. After this, you should be able to connect using the new password.
Alternatively, you can set the new password using the mysql client:
1. Take down and restart mysqld with the --skip-grant-tables option as described above.
2. Connect to the mysqld server with:
shell> mysql -u root mysql
3. Issue the following commands in the mysql client:
mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
mysql> FLUSH PRIVILEGES;
4. After this, you should be able to connect using the new password.
5. You can now stop mysqld and restart it normally.
|
_________________ 支持洛杉矶华人,点评洛杉矶华人商家
|
|
|
|
返回页首
|
|
 |
|
|
|
| |
|
发布人: Mrs LA
发布于: 2008/01/23, 12:09 am
|
|
|
1. Kill the server (kill -9 mysqld, you will probably need to log in as OS
user 'root').
2. Start the server with the option skip-grant-tables, e. g.
mysqld --skip-grant-tables.
3. Connect to the server using MySQL Monitor, the command line tool: shell>
mysql (You can connect without username/password.)
4. On the SQL command line, do: GRANT ALL ON *.* TO 'superuser'@'localhost'
IDENTIFIED BY 'iwillremember' WITH GRANT OPTION;
5. Exit MySQL Monitor.
6. On the shell, do: mysqladmin -usuperuser -piwillremember shutdown
7. On the shell, do: mysqld (to start the server again)
Now, this new 'superuser' can create accounts for regular users.
|
_________________ 支持洛杉矶华人,点评洛杉矶华人商家
|
|
|
|
返回页首
|
|
 |
|
热门标签: HTTP(8), MySQL(8), Apache(5), PHP(4), SEO(4), google(4), 百度(3), FTP(2), Linux(2), 域名注册(2), Server(2), 免费软件(1), 知识产权(1), 中国搜索(1), 爬虫(1), 搜索引擎(1), FTP Jail(1), vsFTPD(1), qihoobot(1), BadBot(1), Ports(1), Network(1), Remove Pass-phase(1), SSL(1), Installation(1), 缓存(1), Cache(1), Proftpd(1), Index(1), 新闻组(1)
|
相关搜索: mysql root password(20), Attempt to serve directory(3), mysql password(3), mysql forget(3), forget mysql root password(2), forget mysql password(2), mysql password forget(2), mysql root password mysqladmin(2), mysql root forget password(2), mysql root password forget(2), pass word 9 you com(1), mysql root passwor(1), mysql forget root(1), mysql & forget root password(1), UPDATE user SET Password=PASSWORD'' where USER='root'; skip(1), mysql 4.1 forget password(1), root password(1), mysql password root(1), mysql4 forgot root password(1), mysqladmin pass(1)
|
|