Mar 202006
 

Solaris 10にはMySQLも含まれているのですが、CSW版はMySQL5も出たりと最新版への追従がよさげなので、CSW版を入れて動かすことにしました。

まずはpkg-getでサーバパッケージを入れます(パッケージ名はCSWmysql4)。依存パッケージもいろいろ導入されます。。

# pkg-get -i mysql4

起動はSMF管理でおこなわれます。起動スクリプトである/opt/csw/lib/svc/method/svc-mysql4を見ると、いろいろ準備すべきことが書いてあります。初期データベースは作成しませんから作ってね、とか。
/opt/csw/mysql4/share/mysql/quick_start-cswを実行するか、手作業で準備しろと記述されてますが、ここでは手作業でおこなってみました。

まずは、初期データベースを作成します。

# /opt/csw/mysql4/bin/mysql_install_db
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:
/opt/csw/mysql4/bin/mysqladmin -u root password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /opt/csw/mysql4 ; /opt/csw/mysql4/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 /opt/csw/mysql4/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
#

次にmy.cnfを用意します

# cp -p /opt/csw/mysql4/share/mysql/my-small.cnf /opt/csw/mysql4/var/my.cnf

最後にsvcadmで起動し、パスワードを設定します。

# svcadm enable cswmysql4
# /opt/csw/mysql4/bin/mysqladmin -u root password '********'
# /opt/csw/mysql4/bin/mysqladmin -u root -h server.example.jp password '********'

最後に接続確認。

$ /opt/csw/mysql4/bin/mysql -u root -p mysql
Enter password: ********
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 4.1.18

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 

Sorry, the comment form is closed at this time.