shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell>
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
mysqladmin -u root password '新口令' ##该口令
bin/mysql -u root -p ##登陆
Source Installation Overview
----------------------------------
The basic commands you must execute to install a MySQL source
distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell>
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
For versions of MySQL older than 4.0, substitute `bin/safe_mysqld' for
`bin/mysqld_safe' in the final command.
If you start from a source RPM, do the following:
shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm
This makes a binary RPM that you can install. For older versions of RPM,
you may have to replace the command `rpmbuild' with `rpm' instead.
*Note*: This procedure does not set up any passwords for MySQL
accounts. After following the procedure, proceed to *Note
Post-installation::, for post-installation setup and testing.
A more detailed version of the preceding description for installing
MySQL from a source 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. They may also be called `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.
3. Obtain a distribution file from one of the sites listed in *Note
Getting MySQL: Getting MySQL.
4. Unpack the distribution into the current directory:
shell> gunzip < /PATH/TO/MYSQL-VERSION.tar.gz | tar xvf -
This command creates a directory named `mysql-VERSION'.
With GNU `tar', no separate invocation of `gunzip' is necessary.
You can use 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 top-level directory of the unpacked
distribution:
shell> cd mysql-VERSION
Note that currently you must configure and build MySQL from this
top-level directory. You cannot build it in a different directory.
6. Configure the release and compile everything:
shell> ./configure --prefix=/usr/local/mysql
shell> make
When you run `configure', you might want to specify some options.
Run `./configure --help' for a list of options. *Note `configure'
options: configure options, discusses some of the more useful
options.
If `configure' fails and you are going to send mail to a MySQL
mailing list to ask for assistance, please include any lines from
`config.log' that you think can help solve the problem. Also
include the last couple of lines of output from `configure'. Post
the bug report using the `mysqlbug' script. *Note Bug reports::.
If the compile fails, see *Note Compilation problems:: for help.
7. Install the distribution:
shell> make install
If you want to set up an option file, use one of those present in
the `support-files' directory as a template. For example:
shell> cp support-files/my-medium.cnf /etc/my.cnf
You might need to run these commands as `root'.
If you want to configure support for `InnoDB' tables, you should
edit the `/etc/my.cnf' file, remove the `#' character before the
option lines that start with `innodb_...', and modify the option
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




