湖濱散記部落格的樹心幽徑[login][主頁]
297:20140916在fedora19裝妥mysql5.0.27資料庫伺服程式

(1)
[root@blackbear lnx]# tar xvzf mysql-5.0.27.tar.gz
[root@blackbear mysql-5.0.27]# ls
aclocal.m4      dbug                ltmain.sh    regex
bdb             depcomp             Makefile.am  scripts
BUILD           Docs                Makefile.in  server-tools
ChangeLog       EXCEPTIONS-CLIENT   man          sql
client          extra               missing      sql-bench
CMakeLists.txt  heap                myisam       sql-common
cmd-line-utils  include             myisammrg    SSL
config          innobase            mysql-test   strings
config.guess    install-sh          mysys        support-files
config.h.in     INSTALL-SOURCE      ndb          tests
config.sub      INSTALL-WIN-SOURCE  netware      tools
configure       libmysql            os2          vio
configure.in    libmysqld           pstack       win
COPYING         libmysql_r          README       zlib

(2)
[root@blackbear mysql-5.0.27]# cat INSTALL-SOURCE |more
:

  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.

  3. Obtain a distribution file using the instructions in *Note
     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 other options.
     Run `./configure --help' for a list of options.  *Note
     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'. To
     file a bug report, please use the instructions in *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
     values to be what you want. See *Note option-files::, and *Note
     innodb-configuration::.

  8. Change location into the installation directory:

          shell> cd /usr/local/mysql

  9. If you haven't installed MySQL before, you must create the MySQL
     grant tables:

          shell> bin/mysql_install_db --user=mysql

     If you run the command as `root', you should use the `--user'
     option as shown. The value of the option should be 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 that
     user, you can omit the `--user' option.

     After using `mysql_install_db' to create the grant tables for
     MySQL, you must restart the server manually. The `mysqld_safe'
     command to do this is shown in a later step.

 10. Change the ownership of program binaries to `root' and ownership
     of the data directory to the user that you run `mysqld' as.
     Assuming that you are located in the installation directory
     (`/usr/local/mysql'), the commands look like this:

          shell> chown -R root  .
          shell> chown -R mysql var
          shell> chgrp -R mysql .

     The first command changes the owner attribute of the files to the
     `root' user. The second changes the owner attribute of the data
     directory to the `mysql' user. The third changes the group
     attribute to the `mysql' group.

 11. 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; see also
     *Note automatic-start::.

 12. You can set up new accounts using the `bin/mysql_setpermission'
     script if you install the `DBI' and `DBD::mysql' Perl modules. For
     instructions, see *Note perl-support::.
(3)
[root@blackbear mysql-5.0.27]# cat /etc/passwd|grep mysql
[root@blackbear mysql-5.0.27]# groupadd mysql
[root@blackbear mysql-5.0.27]# useradd -g mysql mysql
[root@blackbear mysql-5.0.27]#
(4)
[root@blackbear mysql-5.0.27]#  ./configure --prefix=/usr/local/mysql
:
checking for termcap functions library... configure: error: No curses/termcap library found

(5)
[root@blackbear mysql-5.0.27]# yum -y install ncurses-devel
Loaded plugins: langpacks, refresh-packagekit
updates/19/i386/metalink                                                                              | 6.3 kB  00:00:00
updates                                                                                               | 4.9 kB  00:00:00
updates/19/i386/primary_db                                                                            | 9.9 MB  00:00:14
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.i686 0:5.9-11.20130511.fc19 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================
 Package                        Arch                  Version                                  Repository               Size
=============================================================================================================================
Installing:
 ncurses-devel                  i686                  5.9-11.20130511.fc19                     fedora                  713 k

Transaction Summary
=============================================================================================================================
Install  1 Package

Total download size: 713 k
Installed size: 2.1 M
Downloading packages:
ncurses-devel-5.9-11.20130511.fc19.i686.rpm                                                           | 713 kB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ncurses-devel-5.9-11.20130511.fc19.i686                                                                   1/1
  Verifying  : ncurses-devel-5.9-11.20130511.fc19.i686                                                                   1/1

Installed:
  ncurses-devel.i686 0:5.9-11.20130511.fc19

Complete!
[root@blackbear mysql-5.0.27]#

(6)

[root@blackbear mysql-5.0.27]#  ./configure --prefix=/usr/local/mysql

:
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.

Thank you for choosing MySQL!

[root@blackbear mysql-5.0.27]#

[root@blackbear mysql-5.0.27]# make
:
make[1]: Leaving directory `/root/lnx/mysql-5.0.27'
[root@blackbear mysql-5.0.27]#

(7)
[root@blackbear mysql-5.0.27]# make install
:
make[1]: Leaving directory `/root/lnx/mysql-5.0.27'
[root@blackbear mysql-5.0.27]#

(8)
[root@blackbear mysql-5.0.27]# cp support-files/my-medium.cnf /etc/my.cnf
[root@blackbear mysql-5.0.27]# stat /etc/my.cnf
  File: ‘/etc/my.cnf’
  Size: 4912            Blocks: 16         IO Block: 4096   普通檔案
Device: fd01h/64769d    Inode: 2753106     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: unconfined_u:object_r:etc_t:s0
Access: 2014-09-16 16:26:44.594312745 +0800
Modify: 2014-09-16 16:26:44.594312745 +0800
Change: 2014-09-16 16:26:44.594312745 +0800
 Birth: -
[root@blackbear mysql-5.0.27]#

(9)
[root@blackbear mysql-5.0.27]# cd /usr/local/mysql
[root@blackbear mysql]#  bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

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:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h blackbear.kmvs.km.edu.tw password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/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
[root@blackbear mysql]#

(10)
[root@blackbear mysql]# cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &
[1] 31855
[root@blackbear mysql]# nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /usr/local/mysql/var

[root@blackbear mysql]# ps ax|grep mysql
31855 pts/0    S      0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe
31876 pts/0    Sl     0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --user=mysql --pid-file=/usr/local/mysql/var/blackbear.kmvs.km.edu.tw.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock
31886 pts/0    S+     0:00 grep --color=auto mysql
[root@blackbear mysql]#


(11)
[root@blackbear mysql]# /usr/local/mysql/bin/mysqladmin -u root password 'yourpwd'
[root@blackbear mysql]# /usr/local/mysql/bin/mysqladmin -u root -h blackbear.kmvs.km.edu.tw password 'yourpwd'
[root@blackbear mysql]#

(12)
[root@blackbear mysql]# chown -R root  .
[root@blackbear mysql]# chown -R mysql var
[root@blackbear mysql]# chgrp -R mysql .
[root@blackbear mysql]#
[root@blackbear mysql]# cp bin/mysql /usr/local/bin
setup success


select id,article_id,topic,text from lt_articles_text where article_id =297; ok. update lt_articles set num_reads=num_reads +1 where id=297; ok.