# /usr/sfw/bin/mysql_install_db
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables
060118 21:24:03 /usr/sfw/sbin/mysqld: Shutdown Complete
2.创建mysql用户和组:
# groupadd mysql
# useradd -g mysql mysql
# chgrp -R mysql /var/mysql
# chmod -R 770 /var/mysql
# installf SUNWmysqlr /var/mysql d 770 root mysql
3.mysql的配置文件:
Filename Purpose
--------- ---------
defaults-extra-file The file specified with --defaults-extra-file=path
4.创建配置文件:
在solaris中默认的DATADIR是/var/mysql
5.以后台方式启动mysql服务器:
# /usr/sfw/sbin/mysqld_safe --user=mysql &
6.设置mysql用户root的密码:
# cd /usr/sfw/bin
# ./mysqladmin -u root password 'new-password'
# ./mysqladmin -u root -h `hostname` password 'new-password'
7.测试数据库服务器:
# ./mysqlshow -p
Enter password: new-password
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
# ./mysql -u root -p
Enter password: new-password
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.20-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
2 rows in set (0.00 sec)
mysql> quit;
Bye
8.当系统重启时使mysql服务自动启动:
配置完毕。