Use the source code to install MySQL 5.5.9

Source: Internet
Author: User

To Test Database Synchronization on the goldengate heterogeneous platform, you need to test data synchronization between MYSQL and Oracle. Therefore, this article introduces the process of installing MYSQL with source code.

The installation process is as follows:
1. Unzip the installation package
Tar-zcvf package name .tar.gz
2. Compilation and Installation
Make sure that cmake has been downloaded (www.cmake.org) and installed (download, decompress, and modify the environment variables without installation)
Shell> tar zxvf mysql-VERSION.tar.gz
Shell> cd mysql-VERSION
Shell> cmake.
Shell> make
Shell> su-root
Shell> cd mysql-VERSION
Shell> make install DESTDIR = "/usr/local/mysql"

After the installation, the directory is in/usr/local/mysql, dizzy, remove:
[Root @ ora10g mysql] # mv/usr/local/mysql/*/usr/local/mysql/
[Root @ ora10g mysql] # ls-l
Total 0
[Root @ ora10g mysql] # pwd
/Usr/local/mysql
[Root @ ora10g mysql] # cd/usr/local/mysql/
[Root @ ora10g mysql] # ll
Total 192
Drwxr-xr-x 2 root 4096 Mar 1 bin
-Rw-r -- 1 root 17987 Jan 20 06:37 COPYING
Drwxr-xr-x 4 root 4096 Mar 1 23:39 data
Drwxr-xr-x 2 root 4096 Mar 1 docs
Drwxr-xr-x 3 root 4096 Mar 1 23:39 include
-Rw-r -- 1 root 7390 Jan 20 06:37 INSTALL-BINARY
Drwxr-xr-x 3 root 4096 Mar 1 23:39 lib
Drwxr-xr-x 4 root 4096 Mar 1 23: 40 man
Drwxr-xr-x 10 root 4096 Mar 1 mysql-test
-Rw-r -- 1 root 113534 Jan 20 06:37 README
Drwxr-xr-x 2 root 4096 Mar 1 scripts
Drwxr-xr-x 27 root 4096 Mar 1 23:40 share
Drwxr-xr-x 4 root 4096 Mar 1 SQL-runtime
Drwxr-xr-x 2 root 4096 Mar 1 23:40 support-files
Drwxr-xr-x 3 root 4096 Mar 1 23:39 usr
[Root @ ora10g mysql] # rm-rf usr
[Root @ ora10g mysql] # ls-l
Total 188
Drwxr-xr-x 2 root 4096 Mar 1 bin
-Rw-r -- 1 root 17987 Jan 20 06:37 COPYING
Drwxr-xr-x 4 root 4096 Mar 1 23:39 data
Drwxr-xr-x 2 root 4096 Mar 1 docs
Drwxr-xr-x 3 root 4096 Mar 1 23:39 include
-Rw-r -- 1 root 7390 Jan 20 06:37 INSTALL-BINARY
Drwxr-xr-x 3 root 4096 Mar 1 23:39 lib
Drwxr-xr-x 4 root 4096 Mar 1 23: 40 man
Drwxr-xr-x 10 root 4096 Mar 1 mysql-test
-Rw-r -- 1 root 113534 Jan 20 06:37 README
Drwxr-xr-x 2 root 4096 Mar 1 scripts
Drwxr-xr-x 27 root 4096 Mar 1 23:40 share
Drwxr-xr-x 4 root 4096 Mar 1 SQL-runtime
Drwxr-xr-x 2 root 4096 Mar 1 23:40 support-files

[Root @ ora10g mysql] # pwd
/Usr/local/mysql
[Root @ ora10g mysql] # ls-l
Total 188
Drwxr-xr-x 2 mysql 4096 Mar 1 bin
-Rw-r -- 1 mysql 17987 Jan 20 COPYING
Drwxr-xr-x 4 mysql 4096 Mar 1 data
Drwxr-xr-x 2 mysql 4096 Mar 1 docs
Drwxr-xr-x 3 mysql 4096 Mar 1 include
-Rw-r -- 1 mysql 7390 Jan 20 INSTALL-BINARY
Drwxr-xr-x 3 mysql 4096 Mar 1 lib
Drwxr-xr-x 4 mysql 4096 Mar 1 man
Drwxr-xr-x 10 mysql 4096 Mar 1 mysql-test
-Rw-r -- 1 mysql 113534 Jan 20 README
Drwxr-xr-x 2 mysql 4096 Mar 1 scripts
Drwxr-xr-x 27 mysql 4096 Mar 1 share
Drwxr-xr-x 4 mysql 4096 Mar 1 SQL-Audit
Drwxr-xr-x 2 mysql 4096 Mar 1 support-files
[Root @ ora10g mysql] # 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 ora10g 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
Stronugly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon:
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!
[Root @ ora10g mysql] # chown-R root.
[Root @ ora10g mysql] # ll
Total 188
Drwxr-xr-x 2 root mysql 4096 Mar 1 bin
-Rw-r -- 1 root mysql 17987 Jan 20 COPYING
Drwxr-xr-x 5 root mysql 4096 Mar 1 data
Drwxr-xr-x 2 root mysql 4096 Mar 1 docs
Drwxr-xr-x 3 root mysql 4096 Mar 1 include
-Rw-r -- 1 root mysql 7390 Jan 20 INSTALL-BINARY
Drwxr-xr-x 3 root mysql 4096 Mar 1 lib
Drwxr-xr-x 4 root mysql 4096 Mar 1 man
Drwxr-xr-x 10 root mysql 4096 Mar 1 mysql-test
-Rw-r -- 1 root mysql 113534 Jan 20 README
Drwxr-xr-x 2 root mysql 4096 Mar 1 scripts
Drwxr-xr-x 27 root mysql 4096 Mar 1 share
Drwxr-xr-x 4 root mysql 4096 Mar 1 SQL-runtime
Drwxr-xr-x 2 root mysql 4096 Mar 1 support-files
[Root @ ora10g mysql] # chown-R mysql data
[Root @ ora10g mysql] # ls-l
Total 188
Drwxr-xr-x 2 root mysql 4096 Mar 1 bin
-Rw-r -- 1 root mysql 17987 Jan 20 COPYING
Drwxr-xr-x 5 mysql 4096 Mar 1 data
Drwxr-xr-x 2 root mysql 4096 Mar 1 docs
Drwxr-xr-x 3 root mysql 4096 Mar 1 include
-Rw-r -- 1 root mysql 7390 Jan 20 INSTALL-BINARY
Drwxr-xr-x 3 root mysql 4096 Mar 1 lib
Drwxr-xr-x 4 root mysql 4096 Mar 1 man
Drwxr-xr-x 10 root mysql 4096 Mar 1 mysql-test
-Rw-r -- 1 root mysql 113534 Jan 20 README
Drwxr-xr-x 2 root mysql 4096 Mar 1 scripts
Drwxr-xr-x 27 root mysql 4096 Mar 1 share
Drwxr-xr-x 4 root mysql 4096 Mar 1 SQL-runtime
Drwxr-xr-x 2 root mysql 4096 Mar 1 support-files

 

[Root @ ora10g mysql] # bin/mysqld_safe -- user = mysql &
[1] 25271
[Root @ ora10g mysql] # tail-100f/usr/local/mysql/data/ora10g. err
110301 23:56:00 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/data
110301 23:56:01 InnoDB: The InnoDB memory heap is disabled
110301 23:56:01 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
110301 23:56:01 InnoDB: Compressed tables use zlib 1.2.1.2
110301 23:56:01 InnoDB: Using Linux native AIO
110301 23:56:01 InnoDB: Initializing buffer pool, size = 128.0 M
110301 23:56:01 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file./ibdata1 did not exist:
InnoDB: a new database to be created!
110301 23:56:01 InnoDB: Setting file./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110301 23:56:02 InnoDB: Log file./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
110301 23:56:03 InnoDB: Log file./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment (s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110301 23:56:05 InnoDB: Waiting for the background threads to start
110301 23:56:06 InnoDB: 1.1.5 started; log sequence number 0
110301 23:56:06 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
110301 23:56:06 [ERROR] Do you already have another mysqld server running on port: 3306?
110301 23:56:06 [ERROR] Aborting

110301 23:56:06 InnoDB: Starting shutdown...
110301 23:56:07 InnoDB: Shutdown completed; log sequence number 1595675
110301 23:56:07 [Note]/usr/local/mysql/bin/mysqld: Shutdown complete

110301 23:56:07 mysqld_safe mysqld from pid file/usr/local/mysql/data/ora10g. pid ended
110302 00:01:08 mysqld_safe Starting mysqld daemon with databases from/usr/local/mysql/data
110302 0:01:09 InnoDB: The InnoDB memory heap is disabled
110302 0:01:09 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
110302 0:01:09 InnoDB: Compressed tables use zlib 1.2.1.2
110302 0:01:09 InnoDB: Using Linux native AIO
110302 0:01:10 InnoDB: Initializing buffer pool, size = 128.0 M
110302 0:01:10 InnoDB: Completed initialization of buffer pool
110302 0:01:10 InnoDB: highest supported file format is Barracuda.
110302 0:01:11 InnoDB: Waiting for the background threads to start
110302 0:01:12 InnoDB: 1.1.5 started; log sequence number 1595675
110302 0:01:13 [Note] Event schedents: Loaded 0 events
110302 0:01:13 [Note]/usr/local/mysql/bin/mysqld: ready for connections.
Version: '5. 5.9-log' socket: '/tmp/mysql. sock' port: 3306 Source distribution

[Root @ ora10g mysql] #

Cp support-files/mysql. server/etc/init. d/mysql. server

[Root @ ora10g mysql] # bin/mysqladmin-u root shutdown
110302 00:09:00 mysqld_safe mysqld from pid file/usr/local/mysql/data/ora10g. pid ended
[1] + Done bin/mysqld_safe -- user = mysql
[Root @ ora10g mysql] #
[Root @ ora10g mysql] #
[Root @ ora10g mysql] # ps-ef | grep-I mysql
Root 25783 11274 0 00:00:00 pts/6 grep-I mysql

So far, the entire source code installation process is complete.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.