免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1048 | 回复: 0
打印 上一主题 下一主题

在solaris 10中配置mysql服务器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-13 17:10 |只看该作者 |倒序浏览
在solaris 10中配置mysql服务器

1,以root用户登录系统并初始化数据库表:
# /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
---------                ---------
/etc/my.cnf              Global options
DATADIR/my.cnf           Server-specific options
defaults-extra-file      The file specified with --defaults-extra-file=path
~/.my.cnf                User-specific options
4.创建配置文件:
在solaris中默认的DATADIR是/var/mysql
# cp /usr/sfw/share/mysql/my-medium.cnf /var/mysql/my.cnf
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服务自动启动:
# ln /etc/sfw/mysql/mysql.server /etc/rc3.d/S99mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc0.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc1.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rc2.d/K00mysql
# ln /etc/sfw/mysql/mysql.server /etc/rcS.d/K00mysql
配置完毕。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36549/showart_300157.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP