Changes between Version 72 and Version 73 of ServerIntro
- Timestamp:
- Feb 21, 2013, 2:08:53 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ServerIntro
v72 v73 143 143 === MySQL notes === #MySQL-notes 144 144 * After installing and running the server, 145 grant permissions for your own account and for the account under146 which Apache runs ('nobody' in the following;147 may be different on your machine).145 grant permissions for the 'db_user' account (usually boincadm). 146 The 'db_name' is usually the short name of the project. 147 The credentials (db_user, db_name, db_passwd) are stored in the project's [ProjectOptions#db config.xml]. 148 148 All MySQL accounts should be password protected, especially `root`. 149 149 {{{ 150 150 mysql -u root 151 grant all on *.* to yourname@localhost identified by 'password'; 152 grant all on *.* to yourname identified by 'password'; 153 grant all on *.* to nobody@localhost identified by 'password'; 154 grant all on *.* to nobody identified by 'password'; 155 }}} 156 157 {{{ 158 #!comment 159 This is a more secure approach but will not work for new projects because make_project tries to create and drop the database on its own. Existing projects should change the permissions accordingly. 160 151 CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'db_passwd'; 152 GRANT CREATE,DROP ON *.* TO 'db_user'@'localhost' 153 GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,REFERENCES,INDEX,ALTER,CREATE TEMPORARY TABLES, LOCK TABLES ON `db_name`.* TO 'db_user'@'localhost'; 154 }}} 155 Existing projects should change the permissions accordingly by first revoking 156 all rights and grant with the above example. The user 'nobody' means the 157 account under which Apache runs (may be different on your machine) which does 158 not need access anymore. 159 {{{ 161 160 mysql -u root 162 CREATE DATABASE `db_name`; 163 CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'db_password'; 164 GRANT USAGE ON *.* TO 'db_user'@'localhost' 165 GRANT ALL PRIVILEGES ON `db_name`.* TO 'db_user'@'localhost'; 166 167 mysql -u root 168 REVOKE ALL PRIVILEGES ON *.* FROM 'db_name'@'localhost'; 161 REVOKE ALL PRIVILEGES ON *.* FROM 'db_user'@'localhost'; 162 REVOKE ALL PRIVILEGES ON *.* FROM 'db_user'; 169 163 REVOKE ALL PRIVILEGES ON *.* FROM 'nobody'@'localhost'; 164 REVOKE ALL PRIVILEGES ON *.* FROM 'nobody'; 165 }}} 166 After creating a project you should also revoke the global DROP and CREATE 167 permission for your 'db_user' like this: 168 {{{ 169 REVOKE ALL PRIVILEGES ON *.* FROM 'db_user'@'localhost'; 170 REVOKE GRANT OPTION ON * . * FROM 'db_user'@'localhost'; 171 GRANT USAGE ON *.* TO 'db_user'@'localhost'; 170 172 }}} 171 173 * Set your `PATH` environment variable to include MySQL programs