you can still access your database and even reset your password using
the command prompt. However, first you should check your my.cnf file
where your password is stored.
1. Stop your MySQL server completely. This can be done by accessing the
Services window inside Windows XP and Windows Server 2003, where you can
stop the MySQL service.
2. Open your MS-DOS command prompt using "cmd" inside the Run window.
Inside it navigate to your MySQL bin folder, such as C:\MySQL\bin using
the cd command.
3. Execute the following command in the command prompt: mysqld.exe -u root --skip-grant-tables
4. Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window.
5. Navigate to your MySQL bin folder, such as C:\MySQL\bin using the cd command.
6. Enter "mysql" and press enter.
7. You should now have the MySQL command prompt working. Type "use mysql;" so that we switch to the "mysql" database.
8. Execute the following command to update the password:
UPDATE user SET Password = PASSWORD('NEW_PASSWORD') WHERE User = 'root';
However, you can now run any SQL command that you wish.
After you are finished close the first command prompt and type "exit;"
in the second command prompt windows to disconnect successfully. You can
now start the MySQL service.
hope this helps
Wednesday, November 28, 2012
Wednesday, August 29, 2012
Setting up email server on CentOS 6.2
Setting up email server on CentOS 6.2 within 5 minutes
This email server supports SMTP(TCP port 25) and IMAPS(secure IMAP,TCP port 993). Now, you can specify this as an outgoing and incoming email server on email client such as Thunderbird on your PC.
1. Install packages
Three packages are required for this. Install them if you haven't done yet.
$yum install sendmail
$yum install sendmail-cf
$yum install dovecot
The role of sendmail is to receive emails destined to you and keep them in your mailbox on email server. Then, dovecot actually delivers those emails to your PC when you open Thunderbird or Microsoft Outlook. For outgoing email, Thunderbird first contacts sendmail, then sendmail relays the email to final destination for you.
2. Configure sendmail
You just need to change 2 lines in configuration file /etc/mail/sendmail.mc
Comment out this to allow receiving email from anywhere.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Add this line
FEATURE(`relay_hosts_only')dnl
Add your PC's full hostname in this file. Create one if this file doesn't exist.
/etc/mail/relay-domains
After changing configuration file, run this command to activate it.
$/etc/mail/make
$service sendmail start
3. Configure dovecot
You just need to edit two files.
In /etc/dovecot/dovtcot.conf, just edit these two lines
protocols = imap
listen = *, ::
In /etc/dovtcot/dovecot.d/10-mail.conf, edit these 3 lines
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_privileged_group = mail
mbox_write_locks = dotlock fcntl
Start dovecot service
$service dovecot start
4. (Optional) Reconfigure iptables only if you are already using iptables
Add these 2 lines into /etc/sysconfig/iptables to allow email to go through firewalls.
-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 993 -j ACCEPT
then, restart iptables by
$service iptables restart
DONE
This is it. Of course, you can do more to enhance the security level of your email server.
For example, you can make sendmail more secure by using SMTP over SSL.
Feel free to suggest any idea about this article. Thanks.
Tuesday, August 28, 2012
"CON" Folder On Desktop
This is very common question in our mind that why we can’t create a folder with name CON, NUL, COM1, COM2, COM3, LPT1, LPT2, LPT3,COM1 to COM9 and LPT1 to LPT9……..
But here we will create folder with these name…….
you need to follow these steps carefully
STEP1: G oto command prompt
STEP2: and type md \\.\\”c:\con” (with quotes)
The above command will create the folder named “con” in Drive C:
To create that folder in your desktop (for Windows XP) replace the ‘c:\con’ with the FULL PATH of your Desktop, Below is an Example:
md \\.\\”C:\Documents and Settings\USER\Desktop\con” (Where USER is your USERNAME)
(You MUST specify the full path within double quotes ["] If it contains spaces)
In Windows 98, your Desktop path would be : C:\windoiws\Desktop (where C: is the drive letter if your Windows installation)
That is all about creating the folder.
BUT DON’T STOP HERE
Because after creating such a folder, you can’t delete it by simply pressing the DEL key.
To delete this kind of folder, use the same command replacing MD with RD. For example:
rd \\.\\”c:\con” (with quotes for path containing spaces)
But here we will create folder with these name…….
you need to follow these steps carefully
STEP1: G oto command prompt
STEP2: and type md \\.\\”c:\con” (with quotes)
The above command will create the folder named “con” in Drive C:
To create that folder in your desktop (for Windows XP) replace the ‘c:\con’ with the FULL PATH of your Desktop, Below is an Example:
md \\.\\”C:\Documents and Settings\USER\Desktop\con” (Where USER is your USERNAME)
(You MUST specify the full path within double quotes ["] If it contains spaces)
In Windows 98, your Desktop path would be : C:\windoiws\Desktop (where C: is the drive letter if your Windows installation)
That is all about creating the folder.
BUT DON’T STOP HERE
Because after creating such a folder, you can’t delete it by simply pressing the DEL key.
To delete this kind of folder, use the same command replacing MD with RD. For example:
rd \\.\\”c:\con” (with quotes for path containing spaces)
Wednesday, December 21, 2011
Delete Failed DCs from Active Directory
How can I delete a failed Domain Controller object from Active Directory?
Now there’s a faster and easier way to squeeze more performance and value out of your network by activating the device capabilities you’ve already paid for!
Download the free Network Config Generator from Solarwinds and in less time than it takes to say “C-L-I”, you can be running config templates that automatically configure both common and advanced network device features.
When you try to remove a domain controller from your Active Directory domain by using Dcpromo.exe and fail, or when you began to promote a member server to be a Domain Controller and failed (the reasons for your failure are not important for the scope of this article), you will be left with remains of the DCs object in the Active Directory. As part of a successful demotion process, the Dcpromo wizard removes the configuration data for the domain controller from Active Directory, but as noted above, a failed Dcpromo attempt might leave these objects in place.
The effects of leaving such remains inside the Active Directory may vary, but one thing is sure: Whenever you'll try to re-install the server with the same computername and try to promote it to become a Domain Controller, you will fail because the Dcpromo process will still find the old object and therefore will refuse to re-create the objects for the new-old server.
In the event that the NTDS Settings object is not removed correctly you can use the Ntdsutil.exe utility to manually remove the NTDS Settings object.
If you give the new domain controller the same name as the failed computer, then you need perform only the first procedure to clean up metadata, which removes the NTDS Settings object of the failed domain controller. If you will give the new domain controller a different name, then you need to perform all three procedures: clean up metadata, remove the failed server object from the site, and remove the computer object from the domain controllers container.
You will need the following tool: Ntdsutil.exe, Active Directory Sites and Services, Active Directory Users and Computers.
Also, make sure that you use an account that is a member of the Enterprise Admins universal group.
Caution: Using the Ntdsutil utility incorrectly may result in partial or complete loss of Active Directory functionality.
To clean up metadata
Now there’s a faster and easier way to squeeze more performance and value out of your network by activating the device capabilities you’ve already paid for!
Download the free Network Config Generator from Solarwinds and in less time than it takes to say “C-L-I”, you can be running config templates that automatically configure both common and advanced network device features.
The effects of leaving such remains inside the Active Directory may vary, but one thing is sure: Whenever you'll try to re-install the server with the same computername and try to promote it to become a Domain Controller, you will fail because the Dcpromo process will still find the old object and therefore will refuse to re-create the objects for the new-old server.
In the event that the NTDS Settings object is not removed correctly you can use the Ntdsutil.exe utility to manually remove the NTDS Settings object.
If you give the new domain controller the same name as the failed computer, then you need perform only the first procedure to clean up metadata, which removes the NTDS Settings object of the failed domain controller. If you will give the new domain controller a different name, then you need to perform all three procedures: clean up metadata, remove the failed server object from the site, and remove the computer object from the domain controllers container.
You will need the following tool: Ntdsutil.exe, Active Directory Sites and Services, Active Directory Users and Computers.
Also, make sure that you use an account that is a member of the Enterprise Admins universal group.
Caution: Using the Ntdsutil utility incorrectly may result in partial or complete loss of Active Directory functionality.
To clean up metadata
- At the command line, type Ntdsutil and press ENTER.
C:\WINDOWS>ntdsutil ntdsutil:
- At the Ntdsutil: prompt, type metadata cleanup and press Enter.
ntdsutil: metadata cleanup metadata cleanup:
- At the metadata cleanup: prompt, type connections and press Enter.
metadata cleanup: connections server connections:
- At the server connections: prompt, type connect to server <servername>, where <servername> is the domain controller (any functional domain controller in the same domain) from which you plan to clean up the metadata of the failed domain controller. Press Enter.
server connections: connect to server server100 Binding to server100 ... Connected to server100 using credentials of locally logged on user. server connections:Note: Windows Server 2003 Service Pack 1 eliminates the need for the above step.
- Type quit and press Enter to return you to the metadata cleanup: prompt.
server connections: q metadata cleanup:
- Type select operation target and press Enter.
metadata cleanup: Select operation target select operation target:
- Type list domains and press Enter. This lists all domains in the forest with a number associated with each.
select operation target: list domains Found 1 domain(s) 0 - DC=dpetri,DC=net select operation target:
- Type select domain <number>, where <number> is the number corresponding to the domain in which the failed server was located. Press Enter.
select operation target: Select domain 0 No current site Domain - DC=dpetri,DC=net No current server No current Naming Context select operation target:
- Type list sites and press Enter.
select operation target: List sites Found 1 site(s) 0 - CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net select operation target:
- Type select site <number>, where <number> refers to the number of the site in which the domain controller was a member. Press Enter.
select operation target: Select site 0 Site - CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net Domain - DC=dpetri,DC=net No current server No current Naming Context select operation target:
- Type list servers in site and press Enter. This will list all servers in that site with a corresponding number.
select operation target: List servers in site Found 2 server(s) 0 - CN=SERVER200,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net 1 - CN=SERVER100,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net select operation target:
- Type select server <number> and press Enter, where <number> refers to the domain controller to be removed.
select operation target: Select server 0 Site - CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net Domain - DC=dpetri,DC=net Server - CN=SERVER200,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net DSA object - CN=NTDS Settings,CN=SERVER200,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net DNS host name - server200.dpetri.net Computer object - CN=SERVER200,OU=Domain Controllers,DC=dpetri,DC=net No current Naming Context select operation target:
- Type quit and press Enter. The Metadata cleanup menu is displayed.
select operation target: q metadata cleanup:
- Type remove selected server and press Enter.
Subscribe to:
Posts (Atom)