mysql.1.txt
author viric@llimona
Thu, 15 May 2008 19:58:47 +0200
changeset 2 4d3e5debb377
parent 0 c66307cca740
permissions -rw-r--r--
New info

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'