# cat /etc/release
Solaris 10 11/06 s10x_u3wos_10 X86
Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 14 November 2006
# pkginfo | grep -i mysql
system SUNWmysqlr mysql - MySQL Database Management System (root component)
system SUNWmysqlt mysql - MySQL Database Management System (test component)
system SUNWmysqlu mysql - MySQL Database Management System (usr component)
# pkgchk -v SUNWmysqlr
/etc
/etc/sfw
/etc/sfw/mysql
/etc/sfw/mysql/README.solaris.mysql
/etc/sfw/mysql/mysql.server
/var
/var/mysql
# pkgchk -v SUNWmysqlt 2>&1 | head
/usr
/usr/sfw
/usr/sfw/bin
/usr/sfw/bin/mysqltest
/usr/sfw/mysql
/usr/sfw/mysql/mysql-test
/usr/sfw/mysql/mysql-test/README
/usr/sfw/mysql/mysql-test/include
/usr/sfw/mysql/mysql-test/include/check_var_limit.inc
/usr/sfw/mysql/mysql-test/include/have_bdb.inc
# pkgchk -v SUNWmysqlu 2>&1 | grep install
/usr/sfw/bin/mysql_install
/usr/sfw/bin/mysql_install_db
/usr/sfw/bin/mysql_secure_installation
/usr/sfw/share/mysql/postinstall
/usr/sfw/share/mysql/preinstall
# cat /etc/sfw/mysql/README.solaris.mysql
# /usr/sfw/bin/mysql_install_db
# ls /var/mysql/
mysql test
# groupadd mysql
# useradd -g mysql mysql
# chgrp -R mysql /var/mysql
# chmod -R 770 /var/mysql
# installf SUNWmysqlr /var/mysql d 770 root mysql
# cp /usr/sfw/share/mysql/my-medium.cnf /var/mysql/my.cnf
# /usr/sfw/sbin/mysqld_safe –user=mysql &
[1] 1063
Starting mysqld daemon with databases from /var/mysql
# ps -ef | grep mysql
root 1063 1047 0 18:00:22 pts/7 0:00 /bin/sh /usr/sfw/sbin/mysqld_safe –user=mysql
mysql 1084 1063 1 18:00:22 pts/7 0:00 /usr/sfw/sbin/mysqld –basedir=/usr/sfw –datadir=/var/mysql –user=mysql –pid
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.24-log
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> show databases;
+———-+
| Database |
+———-+
| mysql |
| test |
+———-+
2 rows in set (0.00 sec)
mysql> quit
Bye
データベースの管理者root (root@localhost) のパスワードを設定しておきます。
# mysqladmin password ‘パスワード’
# mysql -p
Enter password: パスワード
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29 to server version: 4.0.24-log
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> use mysql;
Database changed
mysql> select user,host,password from user where user=’root’ and host=’localhost’;
+——+———–+——————+
| user | host | password |
+——+———–+——————+
| root | localhost | 暗号化パスワード |
+——+———–+——————+
1 row in set (0.00 sec)
mysql>