2013年7月1日月曜日

SolarisのPKGを使用したSolaris上でのMySQL 5.6

Original post: http://anothermysqldba.blogspot.com/2013/06/mysql-56-on-solaris-using-solaris-pkg.html

MySQL.comサイトは、SolarisにMySQLをインストールする方法のドキュメントとの良好な仕事をしていません。 ハイパーリンクは、以下の記載されています。

私が参照し、それが同様に行わ方法の例として、この記事を作成してください。
(私は、bashシェルを好むが、それは私だけです...)

bash-3.2# groupadd mysql
bash-3.2# useradd -g mysql mysql
bash-3.2# pkgadd -d mysql-5.6.12-solaris*.pkg

The following packages are available:
1 mysql MySQL Community Server (GPL)
5.6.12

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all


今、あなたは、少し休憩を取ることができます。 Solarisは、プロセスotを少し取り、ここにインストールしてください。


Processing package instance <mysql> from </export/home/mysql-5.6.12-solaris10*.pkg>

MySQL Community Server (GPL) 5.6.12
Copyright (c) 2000, , Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Using </opt/mysql> as the package base directory.
## Processing package information.
## Processing system information.
1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

The selected base directory </opt/mysql> must exist before
installation is attempted.

Do you want this directory created now [y,n,?,q] y
Using </opt/mysql> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <mysql> [y,n,?] y


Installing MySQL Community Server (GPL) as <mysql>
.....


再び、それはいくつかの作業をさせて...


......2013-06-30 17:40:12 1117 [Note] InnoDB: Starting shutdown...
2013-06-30 17:40:12 1117 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

/opt/mysql/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /opt/mysql/mysql/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 http://shop.mysql.com

New default config file was created as /opt/mysql/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings


Installation of <mysql> was successful.


だから今dev.mysql.comあたりinstructinsに続く

bash-3.2# ln /etc/init.d/mysql /etc/rc3.d/S91mysql
bash-3.2# ln /etc/init.d/mysql /etc/rc0.d/K02mysql


私はデータベースを使用したい場合はだから今、私は動的に1回作成されたrootパスワードを乗り越える必要があります。 私は個人的にこの機能が好きです。


# /etc/init.d/mysql start
Starting MySQL
........ SUCCESS!
bash-3.2# ls -al /.mysql_secret
-rw------- 1 root other 96 Jun 30 17:40 /.mysql_secret
# more /.mysql_secret
# The random password set for the root user at Sun Jun 30 17:40:07 2013 (local time): c29IHIZ4


それでは、私たちが始める準備が整いました私たちは、ログインしてパスワードを変更してみましょう。 率直に言って、あなたは、他の選択肢がない。


bash-3.2# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.12

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> show grants for 'root'@'localhost';
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('somepassword');
Query OK, 0 rows affected (0.04 sec)


そして、それはそれです。 我々は今、行ってもいいし、準備ができている...


mysql> exit
Bye
bash-3.2# rm -f /.mysql_secret
bash-3.2# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.12 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.6.12 |
+-----------+
1 row in set (0.00 sec)


リファレンス| |有用なリンク: