mysql.1.txt
changeset 0 c66307cca740
equal deleted inserted replaced
-1:000000000000 0:c66307cca740
       
     1 MYSQL
       
     2 * Create a database
       
     3   CREATE DATABASE dbname;
       
     4 * Add a new user
       
     5   - Connect to the database:
       
     6     mysql -u root -p mysql
       
     7   - Add the user:
       
     8     GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
       
     9     (*.* can be database.table)
       
    10     (omit WITH GRANT OPTION, if it should not grant)
       
    11     Other privileges:
       
    12        RELOAD,PROCESS,USAGE
       
    13   - Flush privileges:
       
    14     FLUSH PRIVILEGES;
       
    15 
       
    16 * Change the password of a user:
       
    17   - SQL:
       
    18     UPDATE mysql.user SET Password=PASSWORD('newpwd')
       
    19      WHERE User='username';
       
    20      FLUSH PRIVILEGES;
       
    21   - Shell:
       
    22     mysqladmin -u username -h hostname password 'new-password'