ドラフト(2009/2/2)

  • 参考リンク
http://sunsabc.its-abc.net/modules/xfsection/article.php?articleid=23
この記事に沿って設定・導入開始。

# cd /etc/sfw/mysql/
# ls
README.solaris.mysql  mysql.server
# cat README.solaris.mysql
To use mysql a number of post-install procedures need to be made by root.

The following steps are derived from the mysql manual (manual.ps, manual.txt or
manual_toc.html) found in the /usr/sfw/src/mysql/Docs directory.

Initialise the database tables.

# /usr/sfw/bin/mysql_install_db

Create mysql user and group and change data directory group.

# groupadd mysql
# useradd -g mysql mysql
・・・
・・・
・・・
参考サイトによると、
どうやらこのREADME.solaris.mysqlをmysql.shにコピーし、コメント行を反転すればよいようだ。
早速ファイルを作成し、実行した。
# mysql.sh
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
090202 14:24:56  /usr/sfw/sbin/mysqld: Shutdown Complete


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 !
This is done with:
/usr/sfw/bin/mysqladmin -u root password 'new-password'
/usr/sfw/bin/mysqladmin -u root -h shuttle password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
/usr/sfw/bin/mysqld_safe &

You can test the MySQL daemon with the tests in the 'mysql-test' directory:
cd /usr/sfw/mysql/mysql-test; ./mysql-test-run

Please report any problems with the /usr/sfw/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

使用法: chmod [-fR] <absolute-mode> file ...
        chmod [-fR] <symbolic-mode-list> file ...
                <symbolic-mode-list> はコンマで区切られた
        [ugoa]{+|-|=}[rwxXlstugo] のリストです。
# Starting mysqld daemon with databases from /var/mysql
090202 14:25:06  mysqld ended
chmodに対するエラーらしきメッセージがあり。
だめもとで起動確認を行う。
#
# /usr/sfw/bin/mysqladmin -u root -p version
Enter password:
/usr/sfw/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
やっぱりエラー出ました。
ここでよくよくmysql.shを参考サイトと見比べると、15行目のchmodコマンドに相違が!!
> chmod -R 770
< chmod -R 770  /var/mysql
これは気付かなかった。修正して再度mysql.shを実行し直します。
# mysql.sh
Installing all prepared tables
090202 14:46:00  /usr/sfw/sbin/mysqld: Shutdown Complete


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 !
This is done with:
/usr/sfw/bin/mysqladmin -u root password 'new-password'
/usr/sfw/bin/mysqladmin -u root -h shuttle password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/sfw/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
/usr/sfw/bin/mysqld_safe &

You can test the MySQL daemon with the tests in the 'mysql-test' directory:
cd /usr/sfw/mysql/mysql-test; ./mysql-test-run

Please report any problems with the /usr/sfw/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

UX: groupadd: ERROR: mysql is already in use.  Choose another.
UX: useradd: ERROR: mysql is already in use.  Choose another.
installf: ERROR: Not enough space to backup </var/sadm/install/contents>
installf: ERROR: Need=44058 blocks, Available=37614 blocks (block size=512)
ln: /etc/rc3.d/S99mysql: ファイルが存在します。
ln: /etc/rc0.d/K00mysql: ファイルが存在します。
ln: /etc/rc1.d/K00mysql: ファイルが存在します。
ln: /etc/rc2.d/K00mysql: ファイルが存在します。
ln: /etc/rcS.d/K00mysql: ファイルが存在します。
# Starting mysqld daemon with databases from /var/mysql
最終更新:2009年02月02日 15:14