注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

欢迎光临我的博客

 
 
 

日志

 
 

install mysql5.0 on solaris 10  

2008-08-27 08:36:47|  分类: 数据库 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
# cat INSTALL-BINARY

2.4.14. Installing MySQL from tar.gz Packages on Other Unix-Like
Systems

   This section does not apply to MySQL Enterprise Server users.

   This section covers the installation of MySQL binary distributions
   that are provided for various platforms in the form of compressed
   tar files (files with a .tar.gz extension). See Section 2.4.3.4,
   "MySQL Binaries Compiled by MySQL AB," for a detailed list.

   To obtain MySQL, see Section 2.4.4, "How to Get MySQL."

   MySQL  tar  file binary distributions have names of the form
   mysql-VERSION-OS.tar.gz, where VERSION is a number (for example,
   5.0.68), and OS indicates the type of operating system for which
   the distribution is intended (for example, pc-linux-i686).

   In addition to these generic packages, we also offer binaries in
   platform-specific package formats for selected platforms. See
   Section  2.4.7,  "Standard MySQL Installation Using a Binary
   Distribution," for more information on how to install these.

   You need the following tools to install a MySQL tar file binary
   distribution:
     * GNU gunzip to uncompress the distribution.
     * A reasonable tar to unpack the distribution. GNU tar is known
       to work. Some operating systems come with a preinstalled
       version of tar that is known to have problems. For example,
       Mac OS X tar and Sun tar are known to have problems with long
       filenames. On Mac OS X, you can use the preinstalled gnutar
       program. On other systems with a deficient tar, you should
       install GNU tar first.

   If you run into problems and need to file a bug report, please use
   the instructions in Section 1.7, "How to Report Bugs or Problems."

   The basic commands that you must execute to install and use a
   MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &

Note

   This procedure does not set up any passwords for MySQL accounts.
   After  following  the  procedure, proceed to Section 2.4.16,
   "Post-Installation Setup and Testing."

   A  more  detailed  version  of the preceding description for
   installing a binary distribution follows:
    1. Add a login user and group for mysqld to run as:
shell> groupadd mysql
shell> useradd -g mysql mysql
       These commands add the mysql group and the mysql user. The
       syntax  for  useradd and groupadd may differ slightly on
       different versions of Unix, or they may have different names
       such as adduser and addgroup.
       You might want to call the user and group something else
       instead of mysql. If so, substitute the appropriate name in
       the following steps.
    2. Pick  the  directory  under which you want to unpack the
       distribution and change location into it. In the following
       example, we unpack the distribution under /usr/local. (The
       instructions, therefore, assume that you have permission to
       create files and directories in /usr/local. If that directory
       is protected, you must perform the installation as root.)
shell> cd /usr/local
    3. Obtain a distribution file using the instructions in Section
       2.4.4,  "How  to Get MySQL." For a given release, binary
       distributions for all platforms are built from the same MySQL
       source distribution.
    4. Unpack  the distribution, which creates the installation
       directory. Then create a symbolic link to that directory:
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
       The tar command creates a directory named mysql-VERSION-OS.
       The ln command makes a symbolic link to that directory. This
       lets you refer more easily to the installation directory as
       /usr/local/mysql.
       With GNU tar, no separate invocation of gunzip is necessary.
       You can replace the first line with the following alternative
       command to uncompress and extract the distribution:
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
    5. Change location into the installation directory:
shell> cd mysql
       You will find several files and subdirectories in the mysql
       directory. The most important for installation purposes are
       the bin and scripts subdirectories:
          + The  bin directory contains client programs and the
            server.  You  should  add the full pathname of this
            directory to your PATH environment variable so that your
            shell finds the MySQL programs properly. See Section
            2.4.20, "Environment Variables."
          + The scripts directory contains the mysql_install_db
            script used to initialize the mysql database containing
            the  grant  tables  that  store  the  server access
            permissions.
    6. Ensure that the distribution contents are accessible to mysql.
       If you unpacked the distribution as mysql, no further action
       is required. If you unpacked the distribution as root, its
       contents will be owned by root. Change its ownership to mysql
       by  executing  the  following  commands  as  root in the
       installation directory:
shell> chown -R mysql .
shell> chgrp -R mysql .
       The first command changes the owner attribute of the files to
       the mysql user. The second changes the group attribute to the
       mysql group.
    7. If you have not installed MySQL before, you must create the
       MySQL data directory and initialize the grant tables:
shell> scripts/mysql_install_db --user=mysql
       If you run the command as root, include the --user option as
       shown. If you run the command while logged in as that user,
       you can omit the --user option.
       The command should create the data directory and its contents
       with mysql as the owner.
       After creating or updating the grant tables, you need to
       restart the server manually.
    8. Most of the MySQL installation can be owned by root if you
       like. The exception is that the data directory must be owned
       by mysql. To accomplish this, run the following commands as
       root in the installation directory:
shell> chown -R root .
shell> chown -R mysql data
    9. If you want MySQL to start automatically when you boot your
       machine,  you can copy support-files/mysql.server to the
       location  where  your system has its startup files. More
       information can be found in the support-files/mysql.server
       script  itself  and in Section 2.4.16.2.2, "Starting and
       Stopping MySQL Automatically."
   10. You can set up new accounts using the bin/mysql_setpermission
       script if you install the DBI and DBD::mysql Perl modules. See
       Section 4.6.16, "mysql_setpermission --- Interactively Set
       Permissions in Grant Tables." For Perl module installation
       instructions, see Section 2.4.21, "Perl Installation Notes."
   11. If  you would like to use mysqlaccess and have the MySQL
       distribution in some non-standard location, you must change
       the location where mysqlaccess expects to find the mysql
       client. Edit the bin/mysqlaccess script at approximately line
       18. Search for a line that looks like this:
$MYSQL     = '/usr/local/bin/mysql';    # path to mysql executable
       Change the path to reflect the location where mysql actually
       is stored on your system. If you do not do this, a Broken pipe
       error will occur when you run mysqlaccess.

   After everything has been unpacked and installed, you should test
   your distribution. To start the MySQL server, use the following
   command:
shell> bin/mysqld_safe --user=mysql &

   If you run the command as root, you must use the --user option as
   shown. The value of the option is the name of the login account
   that you created in the first step to use for running the server.
   If you run the command while logged in as mysql, you can omit the
   --user option.

   If the command fails immediately and prints mysqld ended, you can
   find  some information in the host_name.err file in the data
   directory.

   More information about mysqld_safe is given in Section 4.3.2,
   "mysqld_safe --- MySQL Server Startup Script."

Note

   The accounts that are listed in the MySQL grant tables initially
   have no passwords. After starting the server, you should set up
   passwords for them using the instructions in Section 2.4.16,
   "Post-Installation Setup and Testing."



real operiter
#cd /
# gunzip mysql-5.0.67-solaris10-i386.tar.gz
# tar -xvf mysql-5.0.67-solaris10-i386.tar
# groupadd mysql
# useradd -g mysql mysql
# cd /usr/local
# ls                                     
bin
# ln -s /mysql-5.0.67-solaris10-i386 mysql
# ls
bin    mysql
# cd mysql
# ls
COPYING            configure          man                support-files
EXCEPTIONS-CLIENT  data               mysql-test         tests
INSTALL-BINARY     docs               scripts
README             include            share
bin                lib                sql-bench
# chown -R mysql .
# chgrp -R mysql .
# cd scripts
# ls
mysql_install_db
# cd ..
# ls
COPYING            configure          man                support-files
EXCEPTIONS-CLIENT  data               mysql-test         tests
INSTALL-BINARY     docs               scripts
README             include            share
bin                lib                sql-bench
# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h node3 password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./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
# chown -R root .
# chown -R mysql data
# bin/mysqld_safe --user=mysql &
2894
# Starting mysqld daemon with databases from /mysql-5.0.67-solaris10-i386/data

#
# pwd
/mysql-5.0.67-solaris10-i386
# ls
COPYING            configure          man                support-files
EXCEPTIONS-CLIENT  data               mysql-test         tests
INSTALL-BINARY     docs               scripts
README             include            share
bin                lib                sql-bench
# cd ..
# ls
0603.txt                         mnt
240                              mysql-5.0.67-solaris10-i386
@LongLink                        mysql-5.0.67-solaris10-i386.pkg
TT_DB                            net
bin                              opt
boot                             pidgin-2.2.2.tar.bz2.part
cdrom                            platform
core                             proc
dev                              s
devices                          sbin
etc                              system
export                           tmp
home                             u01
hs_err_pid5989.log               umask 022
kernel                           usr
lib                              var
lost+found                       vol
# pqwd
pqwd: not found
# pwd
/
# cd /usr
# ls
5bin        aset        j2se        net         pub         tmp
SUNWale     bin         java        news        sadm        ucb
X           ccs         jdk         oasys       sbin        ucbinclude
X11         demo        kernel      old         sfw         ucblib
X11R6       dict        kvm         openwin     share       vmsys
adm         dt          lib         perl5       snadm       xpg4
apache      games       local       platform    spool       xpg6
apache2     gnome       mail        preserve    src
appserver   include     man         proc        starsuite7
# cd local
# ls
bin    mysql
# cd mysql
# ls
COPYING            configure          man                support-files
EXCEPTIONS-CLIENT  data               mysql-test         tests
INSTALL-BINARY     docs               scripts
README             include            share
bin                lib                sql-bench
# cd bin
# ls
CMakeLists.txt                    mysql_waitpid
comp_err                          mysql_zap
comp_sql.c                        mysqlaccess
make_sharedlib_distribution       mysqlaccess.conf
make_win_bin_dist                 mysqladmin
make_win_src_distribution_old     mysqlbinlog
msql2mysql                        mysqlbug
my_print_defaults                 mysqlcheck
myisam_ftdump                     mysqld
myisamchk                         mysqld-debug
myisamlog                         mysqld_multi
myisampack                        mysqld_safe
mysql                             mysqldump
mysql_client_test                 mysqldumpslow
mysql_config                      mysqlhotcopy
mysql_convert_table_format        mysqlimport
mysql_explain_log                 mysqlmanager
mysql_find_rows                   mysqlshow
mysql_fix_extensions              mysqltest
mysql_fix_privilege_tables        mysqltestmanager
mysql_fix_privilege_tables_sql.c  mysqltestmanager-pwgen
mysql_secure_installation         mysqltestmanagerc
mysql_setpermission               perror
mysql_tableinfo                   replace
mysql_tzinfo_to_sql               resolve_stack_dump
mysql_upgrade                     resolveip
mysql_upgrade_shell               safe_mysqld
# mysql
mysql: not found
# ./mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.04 sec)

mysql> exit

  评论这张
 
阅读(543)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017