Set a password for MySQL database server

  • Hello,

    I donno how to set a password for MySQL database server! Everyone can use my server by only entering username root! Who can help plz?


  • sorry bud... i beat you to it :D

    oh btw if you forget your pw try this

    [root@host root]#killall mysqld
    [root@host root]#/usr/libexec/mysqld -Sg --user=root &
    [root@host root]# mysql
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1 to server version: 3.23.41

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

    mysql> USE mysql
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    mysql> UPDATE user
    -> SET password=password("newpassword")
    -> WHERE user="root";
    Query OK, 2 rows affected (0.04 sec)
    Rows matched: 2 Changed: 2 Warnings: 0

    mysql> flush privileges;
    Query OK, 0 rows affected (0.01 sec)

    mysql> exit;
    [root@host root]#killall mysqld


  • root@u-1:/home/u-1# mysql -u root mysql
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1 to server version: 3.23.47

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

    mysql> SET PASSWORD FOR root@localhost=PASSWORD('rubberchicken');
    Query OK, 0 rows affected (0.06 sec)

    mysql>


  • Ok thanks guys, I made it.


  • MySQL Manual A.4.1 How to Reset the Root Password (http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html)







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Set a password for MySQL database server , Please add it free.

    7 January 2009 | cameltoepants.com | edit