mysql. Создать базу и пользователя
2 027
Задача- создать базу данных, пользователя и дать все права на эту базу этому пользователю.
[sourcecode language=»js»]
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 620
Server version: 5.0.92-log FreeBSD port: mysql-server-5.0.92
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> create database base;
Query OK, 1 row affected (0.00 sec)
mysql> grant usage on *.* to user@localhost identified by ‘password’;
Query OK, 0 rows affected (0.03 sec)
mysql> grant all privileges on base.* to user@localhost;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[/sourcecode]
Categories: Всякое важное
Утро вечера мудренее.