Sql notater

From Teknologisk videncenter
Jump to: navigation, search

Moodle

[root@sun /usr/local/www/data/moodle]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3491
Server version: 5.0.67 FreeBSD port: mysql-server-5.0.67_1

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
| wikidb             |
+--------------------+
4 rows in set (0.02 sec)
mysql> CREATE DATABASE moodle;
Query OK, 1 row affected (0.02 sec)

mysql> ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;      Query OK, 1 row affected (0.00 sec)

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES, DROP, INDEX, ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'secret';
Query OK, 0 rows affected (0.02 sec)

mysql> quit
Bye
[root@sun /usr/local/www/data/moodle]# mysqladmin -u root -p reload
Enter password:
[root@sun /usr/local/www/data/moodle]#