• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 643
  • Last Modified:

deleted root user mysql on windows 2003

Hi,

I have accidentally deleted the root user on my Mysql server, I have tried this:
http://www.experts-exchange.com/Databases/Mysql/Q_21434019.html 

But it fails here:
In the second window login to mysql server

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql

With this error:
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>cd C:\Program Files\MySQL\MySQL Server 4.1\bin

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

C:\Program Files\MySQL\MySQL Server 4.1\bin>

Help!
0
1desman1
Asked:
1desman1
  • 3
  • 3
1 Solution
 
UmeshMySQL Principle Technical Support EngineerCommented:
Hi!

Did u start mysql server with skip-grant-tables option? then follow the second steps from http://www.experts-exchange.com/Databases/Mysql/Q_21434019.html 
0
 
1desman1Author Commented:
Yes I did - via command prompt then I tried in servces console
0
 
UmeshMySQL Principle Technical Support EngineerCommented:

Try this..

In the first window..
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqld-nt.exe --skip-grant-tables

don't close this window... if this won't worked try with mysqld instead of mysqld-nt

open second window ...

C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

(ODBC@localhost) [(none)]> use mysql
Database changed

(ODBC@localhost) [mysql]> INSERT INTO user VALUES('%','root',password('123456'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','','','');

//if u get any column count mismatch error then desc user table & check out the columns..

(ODBC@localhost) [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.16 sec)


from the taskbar end the process mysqld-nt ...then start mysql service as you were doing earlier..
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
1desman1Author Commented:
Tried that, still get the error when I open the second command prompt with the::
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

Thanks for your help though
0
 
1desman1Author Commented:
I have placed the skip-grant-tables in the my.ini file and it has finally skiped the priviledges, but now comes up with this error::


Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Mark$Hope>cd C:\Program Files\MySQL\MySQL Server 4.1\b
in>
The syntax of the command is incorrect.

C:\Documents and Settings\Mark$Hope>cd C:\Program Files\MySQL\MySQL Server 4.1\bin


C:\Program Files\MySQL\MySQL Server 4.1\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.16-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>  INSERT INTO user VALUES('%','root',password('123456'),'Y','Y','Y','Y','Y
','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','
','','');
ERROR 1046 (3D000): No database selected
mysql>
0
 
UmeshMySQL Principle Technical Support EngineerCommented:
yoyu must use the database...

:\Program Files\MySQL\MySQL Server 4.1\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.16-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>use mysql

mysql>  INSERT INTO user VALUES('%','root',password('123456'),'Y','Y','Y','Y','Y
','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','
','','');


0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now