mysql.1.txt
author llbatlle@taga
Wed, 31 Dec 2008 12:09:04 +0100
changeset 4 3ecde21e0834
parent 0 c66307cca740
permissions -rw-r--r--
New commit from the office.

MYSQL
* Create a database
  CREATE DATABASE dbname;
* Add a new user
  - Connect to the database:
    mysql -u root -p mysql
  - Add the user:
    GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
    (*.* can be database.table)
    (omit WITH GRANT OPTION, if it should not grant)
    Other privileges:
       RELOAD,PROCESS,USAGE
  - Flush privileges:
    FLUSH PRIVILEGES;

* Change the password of a user:
  - SQL:
    UPDATE mysql.user SET Password=PASSWORD('newpwd')
     WHERE User='username';
     FLUSH PRIVILEGES;
  - Shell:
    mysqladmin -u username -h hostname password 'new-password'