今回は、rootのパスワード設定、データベース領域の作成、そのデータベース領域を使用するユーザーの作成まで。
MySQLのrootユーザーのパスワード'root'を設定
-----------------------------------------------------------------------------
Last login: Sat Nov 30 18:18:22 on ttys000
ucchanx$ /usr/local/mysql/bin/mysqladmin -u root password 'root'
-----------------------------------------------------------------------------
rootでログイン
-----------------------------------------------------------------------------
ucchanx$ /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-----------------------------------------------------------------------------
「study」という名前のデータベース領域を作る
-----------------------------------------------------------------------------
mysql> create database study;
Query OK, 1 row affected (0.01 sec)
-----------------------------------------------------------------------------
「study」データベースのすべての操作ができる「ucchanx」ユーザーをパスワードucchanxで作る
-----------------------------------------------------------------------------
mysql> GRANT ALL PRIVILEGES ON study.* TO ucchanx@localhost IDENTIFIED BY 'ucchanx';
Query OK, 0 rows affected (0.00 sec)
MySQLのrootユーザーのパスワード'root'を設定
-----------------------------------------------------------------------------
Last login: Sat Nov 30 18:18:22 on ttys000
ucchanx$ /usr/local/mysql/bin/mysqladmin -u root password 'root'
-----------------------------------------------------------------------------
rootでログイン
-----------------------------------------------------------------------------
ucchanx$ /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-----------------------------------------------------------------------------
「study」という名前のデータベース領域を作る
-----------------------------------------------------------------------------
mysql> create database study;
Query OK, 1 row affected (0.01 sec)
-----------------------------------------------------------------------------
「study」データベースのすべての操作ができる「ucchanx」ユーザーをパスワードucchanxで作る
-----------------------------------------------------------------------------
mysql> GRANT ALL PRIVILEGES ON study.* TO ucchanx@localhost IDENTIFIED BY 'ucchanx';
Query OK, 0 rows affected (0.00 sec)