I have lost my MySQL root or pmauser password 如果删除MySQL的root或者pma用户
2013-04-27 22:17
507 查看
I
have lost my MySQL root or pmauser password
http://bravo.newnetenterprises.com/wordpress/faq/i-have-lost-my-mysql-root-or-pmauser-password/No panicking!
The developers of XAMPP included a utility to ‘repair’ the MySQL installation. Its the ‘resetroot.bat’ batch file found in c:\xammp\mysql\ Note: this will even work if you got really in trouble by deleting or changing either of these accounts.
Unfortunately, that particular developer didn’t test it, so it needs one fix.
The complete Fix
- Open the file in your editor- Find the line that begins:
mysql\bin\mysqld.exe
- Right after –no-defaults, insert –datadir=c:/xampp/mysql/data (or the full path to your MySQL data folder). Be sure to have at least one space between defaults and the –datadir= .
- Line 18 should now look like this:
mysql\bin\mysqld.exe --no-defaults --datadir=c:/xampp/mysql/data --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone <resetroot.sql >resetroot.err 2>&1
- Save the file
- NOW – MAKE SURE THE MYSQL SERVER IS STOPPED! in the XAMPP Control Panel -
- Execute the file either by double-clicking in Windows Explorer or opening a Command window (DOS prompt) in \xampp\mysql and typing resetroot.bat and pressing Enter.
- Start the MySQL database in the XAMPP Control Panel. You should be able to access it now.
Note: If you have modified your phpMyAdmin’s config.inc.php, you will need to change the passwords for root and pmauser to ” (single quotes with no intervening space). The default config.inc.php looks like this:
/* Authentication type and info */ $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['AllowNoPassword'] = true;
/* Server parameters */
$cfg['Servers'][$i]['host'] = ‘localhost’;
$cfg['Servers'][$i]['connect_type'] = ‘tcp’;
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = ‘mysqli’;
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = ‘pma’;
$cfg['Servers'][$i]['controlpass'] = ”;
You can use the built-in XAMPP security page to set new passwords if you wish, its found at:
http://localhost/security/xamppsecurity.php
If you check the text boxes – your settings will be written to a textfile so you can recover them.
The explanation:.
MySQL contains a special database that contains the information about the state of MySQL on your server – its the ‘mysql’ database (you can look at in in phpMyAdmin, with the mySQL monitor, or a MySQL GUI tool like MySQL Workbench. This tool (resetroot.bat)builds a temporary file that contains the SQL commands to set the root and pmauser entries in the Users table back to their defaults amd then starts the MySQL server in a condition to take exceptional commands.
Special thanks to Nobbie and Altrea of the Apache
Friends Forum
More
information on resetting the root password from dev.mysql.com
相关文章推荐
- mysql误删除root用户或者忘记root密码时的解决办法(转)
- mysql误删除root用户或者忘记root密码时的解决办法
- mysql误删除root用户或者忘记root密码时的解决办法
- mysql报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password)错误或者远程用户不能登录
- MySQL忘记密码 或者误删除root用户有效解决办法
- 解决Mysql 5.1误删除root用户
- 不小心把mysql的root用户删除了
- Change or Set the MySQL Root password
- 删除MySQL的默认root用户
- mysql 创建root用户和普通用户及修改删除功能
- mac系统mysql忘记root密码或者误删root用户的详细解决步骤
- MySql中添加用户,新建数据库,用户授权,删除用户,修改密码,root密码丢失
- mysql user表root 用户误删除解决方法
- 删除mysql的root用户,重建本地用户及远程用户
- mysql误删root用户或者忘记root密码解决方法
- 误删除mysql中的所用用户,如何重新设置root账号和密码
- mysql 5.5之后没有了password字段,这样添加一条root用户
- 删除mysql的root用户恢复方法
- mysql update完root用户密码后,再登陆报错”Access denied for user 'root'@'localhost' (using password: YES)“的解决方法
- mysql的root用户删除后的解决办法