mysqlサーバを起動します。
landisk:/usr/local/bin# /etc/init.d/mysql.server start
動作確認その1(psコマンドで確認してみます。)
landisk:/usr/local/bin# ps -a | grep mysql
4023 ttyp0 00:00:00 safe_mysqld
4039 ttyp0 00:00:00 mysqld
4040 ttyp0 00:00:00 mysqld
4041 ttyp0 00:00:00 mysqld
動作確認その2(データベースを表示してみます。)
landisk:/usr/local/bin# /usr/local/mysql/bin/mysqlshow
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
動作確認その3(ファイル類の確認)
landisk:/usr/local/bin# ls -l /usr/local/mysql/var
total 16
-rw-rw---- 1 mysql root 87 May 3 16:20 landisk.err ← エラーログ
-rw-rw---- 1 mysql mysql 5 May 3 16:20 landisk.pid ← pid
drwx------ 2 mysql mysql 4096 May 3 16:06 mysql ← データベース
drwx------ 2 mysql mysql 4096 May 3 16:06 test ← データベース
landisk:/usr/local/bin# mysqladmin -u root password 'MySQLのrootパスワード'
設定したパスワードでアクセスできるか確認しておきましょう。
landisk:/usr/local/bin# mysql -u root -p
Enter Paaword: MySQLの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> exit
Bye
landisk:/usr/local/bin#
付録1: MySQLデータベースの作成方法
ユーザ名 user 、パスワード passwd というアカウントで使用できる、データベース testdb を作成する例を示します。
landisk:~# mysql -u root -p
Enter password: ← MySQLのrootパスワード
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 173 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create databasetestdb;
Query OK, 1 row affected (0.09 sec)
mysql> grant all ontestdb.* to user@localhost identified by "passwd";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
landisk:~#
できたか確認してみます。
landisk:~# /usr/local/mysql/bin/mysqlshow -uuser-ppasswdtestdb
Database: testdb
+--------+
| Tables |
+--------+
+--------+
landisk:~#