CentOS5.3Linux compile and install mysql-6.0.10-alpha source code and simple settings

Source: Internet
Author: User
Tags localhost mysql
CompressedGNUTARarchive(tar.gz) 6.0.10-alpha34.3MDownload | PickamirrorMD5: ebcefbaca78299f5820794350d0025d5 |

Compressed gnu tar archive (tar.gz) 6.0.10-alpha 34.3 M Download | Pick a implements MD5: ebcefbaca78299f5820794350d0025d5 |

As a server or individual learns programming design, databases are indispensable,

In addition, if the free database does not provide poor functions, we recommend that you select the MySQL database,

Programming for Small and Medium websites or individuals learning databases is enough. Haha.

You can find mysql-related information and download. mysql is now under sun,

Sun was recently acquired by Oracle ....

Source downloads (Source code download) can download the Source code, because we use the compilation method to install.

Compressed gnu tar archive (tar.gz) 6.0.10-alpha 34.3 M Download | Pick a mirror
MD5: ebcefbaca78299f5820794350d0025d5 | Signature
Compile and install the mysql database

Download the mysql-6.0.10-alpha.tar.gz to the CentOS 5.3 system ,,

1, download mysql source code: mysql-6.0.10-alpha.tar.gz

2. There are many files to be decompressed. It may take some time to decompress them.
Src] # tar vxzf mysql-6.0.10-alpha.tar.gz

3. Go to the directory and choose configure, compile, and install.

# Cd mysql-6.0.10-alpha

Configure to generate makefile
] #./Configure -- sysconfdir =/etc

Checking for termcap functions library... configure: error: No curses/termcap library found
An error occurs, that is, an error occurred while generating the makefile file.

[Root @ localhost mysql-6.0.10-alpha] # make
Make: *** No targets specified and no makefile found. Stop.
If you have to enter the make command, the makefile is not generated successfully.

Solution:
Let's add -- with-named-curses-libs =/usr/lib/libncursesw. so.5 to generate makefile
./Configure -- sysconfdir =/etc -- with-named-curses-libs =/usr/lib/libncursesw. so.5

Thank you for choosing MySQL!
The makefile is successfully generated.

Make Compilation: it takes a long time.
] # Make

Compilation and installation takes a long time, but it should be applicable to any release version.
In Linux, during the compilation process, I will not play the video and cut off some of it. I have completed compilation.

Make [1]: Leaving directory '/opt/mysql-6.0.10-alpha/SQL-Shanghai'
Making all in win
Make [1]: Entering directory '/opt/mysql-6.0.10-alpha/win'
Make [1]: Nothing to be done for 'all '.
Make [1]: Leaving directory '/opt/mysql-6.0.10-alpha/win'
Final Installation
] # Make install

After compilation and installation are completed, it may take a long time. How can I determine whether the machine is dead?
Observe the hard drive lights of the host. during compilation and installation, the hard drive lights flash and data is read.

Copy the configuration file below
] # Cp/usr/local/share/mysql/my-large.cnf/etc/my. cnf

After configuring mysql, modify/etc/my. cnf.

4. initialize the database
# Useradd-d/usr/local/var mysql
# Su-mysql
$/Usr/local/bin/mysql_install_db

An error occurred during initialization.

Installing MySQL system tables...
090518 7:16:41 [ERROR]/usr/local/libexec/mysqld: unknown option '-- skip-federated'
090518 7:16:41 [ERROR] Aborting

090518 7:16:41 [Note]/usr/local/libexec/mysqld: Shutdown complete

The solution is to delete the mysql folder under/usr/local/var first.

Rm-rf/usr/local/var/mysql

Then modify vi/etc/my. cnf

Find skip-federated and comment it out, that is, change it to ### skip-federated and save it and exit.

Su-mysql uses the mysql identity to reinitialize

/Usr/local/bin/mysql_install_db

This is a success. No error message is displayed.
5. Start the server
[Mysql @ localhost var] $/usr/local/bin/mysqld_safe &

Now it is successful. Use netstat-tnl to view the default port of mysql 3306.

6. login Test
[Mysql @ localhost local] $ mysql-u root

If it is successful
Mysql>
Mysql> \ s
Mysql> \ q

You can use show databases;

Generally, If you compile and install mysql, we recommend that you follow the steps below:

Promoted to root user, su-

Cp/usr/local/share/mysql. server/etc/init. d/mysqld

The command to close mysql is:/etc/init. d/mysqld stop
[Root @ localhost ~] #/Etc/init. d/mysqld stop
Shutting down mysql000090518 07:26:41 mysqld_safe mysqld from
Pid file/usr/local/var/localhost. localdomain. pid ended SUCCESS!

The close is successful.
Mysql command:/etc/init. d/mysqld start

[Root @ localhost ~] #/Etc/init. d/mysqld start
Starting MySQL. SUCCESS!

Modify the following to automatically run mysql 6.0 when the server is started.
Vi/etc/rc. d/rc. local

I run it in front of tomcat and save it and exit.

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.