< MySQL
Content added Content deleted
imported>mutante (creating a new mysql database and user) |
imported>mutante mNo edit summary |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
->[[MySQL]]->Create User |
|||
Dont use mysql-root because of lazyness ;) |
|||
(set root pw with UPDATE mysql.user SET Password=PASSWORD("new_password") WHERE User="root";) -> [[MySQL#Setting_the_initial_root_password]] |
|||
Create a new user "fnord" with password "foobar".: |
Create a new user "fnord" with password "foobar".: |
||
<pre> |
<pre> |
||
Line 10: | Line 15: | ||
Give permissions to the user "fnord" on all tables of the db "grudnuk": |
Give permissions to the user "fnord" on all tables of the db "grudnuk": |
||
<pre> |
<pre> |
||
GRANT SELECT, INSERT,UPDATE,DELETE,CREATE,DROP |
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP |
||
ON grudnuk.* TO fnord; |
ON grudnuk.* TO fnord; |
||
</pre> |
</pre> |
||
Line 17: | Line 22: | ||
FLUSH PRIVILEGES; |
FLUSH PRIVILEGES; |
||
</pre> |
</pre> |
||
[[Category:Computer]] |
|||
[[Category:Programs]] |
Latest revision as of 21:15, 24 October 2006
->MySQL->Create User
Dont use mysql-root because of lazyness ;) (set root pw with UPDATE mysql.user SET Password=PASSWORD("new_password") WHERE User="root";) -> MySQL#Setting_the_initial_root_password
Create a new user "fnord" with password "foobar".:
INSERT INTO mysql.user (user, host, password) VALUES ('fnord', 'localhost', PASSWORD('foobar'));
Create a new database "grudnuk":
CREATE DATABASE grudnuk;
Give permissions to the user "fnord" on all tables of the db "grudnuk":
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON grudnuk.* TO fnord;
Dont forget to update permissions:
FLUSH PRIVILEGES;