2005年08月25日
4.データベースの作成
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database mtdb;
mysql> show databases ;
+----------+
| Database |
+----------+
| mtdb |
| mysql |
| test |
+----------+
3 rows in set (0.00 sec)
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> grant select,insert,delete,update,create,drop,file,alter,index on mtdb.* to mtuser identified by 'mtpass' ;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
3.My SQLの初期設定
root パスワードの設定
# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for root=password('mysql roorのパスワード') ;
Query OK, 0 rows affected (0.00 sec)
mysql> use mysql ;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from user ;
(userテーブルの内容)
4 rows in set (0.00 sec)
mysql> delete from user where password='';
Query OK, 3 rows affected (0.23 sec)
mysql> select * from user ;
(userテーブルの内容。 ユーザ名無しのデータが無くなったことを確認する)
1 row in set (0.00 sec)
mysql> quit
2.My SQLサーバの起動
# /etc/init.d/mysqld start
MySQL データベースを初期化中: [ OK ]
MySQL を起動中: [ OK ]
1.My SQLのインストール
さて、無事にFedora Core3がインストール出来ましたら、次はデータベースサーバを作りましょう☆
# yum install 'mysql*'