[linux-baslangic] MySQL Password Resetleme

---------

From: Kadir DEMIR (kadirdemir@isnet.net.tr)
Date: Fri 19 Mar 2004 - 08:51:15 EST

  • Next message: Gurkan Aslan: "[linux-baslangic] Re: dosya kopyalama"

       
    Zamaninda ben ugrasitigim icin gondermek istedim.
    How to Reset The Root Password

    If you never set a root password for MySQL, then the server will not require a password at all for connecting as root. It is recommended to always set a password for each user. See section 5.3.1 General Security Guidelines.

    If you have set a root password, but forgot what it was, you can set a new password. The following procedure is for Windows systems, please see below for Unix systems.

    The procedure under Windows:

    You must log onto your system in as Administrator.
    Go to
    Start Menu -> Control Panel -> Administrative Tools -> Services
    Find the MySQL service in the list, and stop it.
    Open a window with the DOS command prompt:
    Start Menu -> Run -> cmd
    We are assuming you installed MySQL to `C:\MYSQL'. If you installed MySQL to another drive/directory, adjust the commands accordingly. At the DOS command prompt, give the following commands:
    C:\> C:\MYSQL\BIN\MYSQLD-NT --skip-grant-tables
    This will start the server in a special mode.
    Keeping the first window open, open a second DOS command prompt, and give the following commands:
    C:\> C:\MYSQL\BIN\MYSQLADMIN -u root flush-privileges password "newpwd"
    C:\> C:\MYSQL\BIN\MYSQLADMIN -u root -p shutdown
    Replace ``newpwd'' with the actual root password that you want to use. The second command will prompt you to enter the new password for access.
    Now you can go back to the Windows Services window, and start the MySQL server in normal mode again.
    In a Unix environment, the procedure is as follows:

    You must log onto your system as either the Unix root user or the same user as mysqld server.
    You must first locate the `.pid' which contains the server's process ID. The exact location and name of this file depends on your distribution, hostname, and configuration. Common locations are: `/var/lib/mysql/', `/var/run/mysqld/' and `/usr/local/mysql/data/'. Generally the base filename is either `mysqld' or your system's hostname. Now you can take down the MySQL server by sending a normal kill (not kill -9) to the mysqld process:
    shell> kill `cat /mysql-data-directory/hostname.pid`
    Restart the MySQL server with the special --skip-grant-tables option:
    shell> mysqld_safe --skip-grant-tables &
    Set a new password for the root@localhost MySQL user:
    shell> mysqladmin -u root flush-privileges password "newpwd"
    Replace ``newpwd'' with the actual root password that you want to use.
    You should now be able to connect using the new password.
    Alternatively, you can set the new password using the mysql client:

    Take down and restart mysqld with the --skip-grant-tables option as described earlier.
    Connect to the mysqld server with:
    shell> mysql -u root mysql
    Issue the following commands in the mysql client:
    mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd')
        -> WHERE User='root';
    mysql> FLUSH PRIVILEGES;
    Replace ``newpwd'' with the actual root password that you want to use.
    You should now be able to connect using the new password.

    Iyi calismalar.

    ---
    linux-baslangic listesinden cikmak  ve tum listeci islemleri icin
    http://liste.linux.org.tr/   adresini kullanabilirisniz.
    Bu listeden cikmak icin
    <a href="mailto:linux-baslangic-request@liste.linux.org.tr?Subject=unsubscribe"> tiklayiniz</a>
    

  • Next message: Gurkan Aslan: "[linux-baslangic] Re: dosya kopyalama"

    ---------

    Bu arsiv hypermail 2.1.6 tarafindan uretilmistir.