Modified: 10 December 2005
パッケージのインストール
"sysinstall"で、を起動し、パッケージからインストールします。
"mysql-client-x.xx.xx"と、"mysql-server-x.xx.xx"をインストールします。
データベースを保管するディレクトリ("/usr/local/var")を作成し、ユーザ権限を設定します。
# mkdir /usr/local/var
# cd /usr/local
# chown -R mysql /usr/local/var
# chgrp -R mysql /usr/local/var初期化します。
# /usr/local/bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables
To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h freebsd-big.co-recipe.com password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr/local ; /usr/local/bin/mysqld_safe &
You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests
Please report any problems with the /usr/local/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
#
MySQLの起動
パッケージのインストールするだけで、とりあえず起動するようになっていますので、再起動すると、MySQLは起動します。
コマンドで、起動させるには、以下のコマンドで行います。
# /usr/local/bin/safe_mysqld --user=mysql &
管理ユーザの設定
必ずしも設定の必要はありませんが、パスワードを設定していたほうがいいので、設定しておいたほうがいいようです。
# /usr/local/bin/mysqladmin -u root -p password 'password'
状態を確認する
# /usr/local/bin/mysqladmin -p version Enter password: ****** /usr/local/bin/mysqladmin Ver 8.41 Distrib 4.1.13, for portbld-freebsd6.0 on i386 Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 4.1.13 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /tmp/mysql.sock Uptime: 7 min 30 sec Threads: 1 Questions: 8 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 1 Queries per second avg: 0.018 #以下のコマンドで、テストしてみます。以下のように表示されれば動作OKです。
# /usr/local/bin/mysqlshow -p Enter password: ****** +-----------+ | Databases | +-----------+ | mysql | | test | +-----------+ # /usr/local/bin/mysqlshow -p mysql Enter password: ****** Database: mysql +--------------+ | Tables | +--------------+ | columns_priv | | db | | func | | host | | tables_priv | | user | +--------------+ # /usr/local/bin/mysql -p -e "select host,db,user from db" mysql Enter password: ****** +------+---------+------+ | host | db | user | +------+---------+------+ | % | test | | | % | test\_% | | +------+---------+------+ #