ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Solaris 10 上MySQL的安装及配置

Solaris 10 上MySQL的安装及配置

原创 Linux操作系统 作者:adrain_001 时间:2012-03-16 12:44:49 0 删除 编辑

【1】上传安装文件mysql-5.0.51a-solaris10-i386.tar.gz


我放在了/smbshare下
-bash-3.00# /usr/sfw/bin/gtar -zxvf mysql-5.0.51a-solaris10-i386.tar.gz 解压

【2】安装


-bash-3.00# groupadd mysql
-bash-3.00# useradd -g mysql mysql
-bash-3.00# cd /usr/local/
-bash-3.00# ln -s /smbshare/mysql-5.0.51a-solaris10-i386 mysql 将原MySQL目录链接到/usr/local下
-bash-3.00# cd mysql
-bash-3.00# chown -R mysql . 改变MySQL目录属主
-bash-3.00# chgrp -R mysql . 改变MySQL目录属组
-bash-3.00# scripts/mysql_install_db --user=mysql 创建MySQL数据字典和初始化授权表
-bash-3.00# chown -R root . 将其他的文件属主改回root
-bash-3.00# chown -R mysql data/ 将data目录属主改为MySQL
安装就完成了
如果你想要MySQL在系统启动时自动启动,可以进行一下步骤。
-bash-3.00# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/
-bash-3.00# ln -s /usr/local/mysql/support-files/mysql.server /etc/rc3.d/S99mysql
-bash-3.00# ln -s /usr/local/mysql/support-files/mysql.server /etc/rc0.d/K01mysql

【3】测试


启动MySQL服务
-bash-3.00# /usr/local/mysql/bin/mysqld_safe --user=mysql &
设置root用户登录MySQL密码
-bash-3.00# /usr/local/mysql/bin/mysqladmin -u root password root
修改密码
-bash-3.00# /usr/local/mysql/bin/mysqladmin -uroot password abc -p
Enter password:
连接MySQL
-bash-3.00# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
到此ok了

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26690043/viewspace-718737/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-02-13

  • 博文量
    113
  • 访问量
    259856