Download MySQL source code and compile and install MySQL in Ubuntu10.10

Source: Internet
Author: User
The first time I installed MySQL on Linux (Ubuntu10.10), I had to pay some twists and turns, and finally I had to figure out my ideas. Let's first talk about the steps for my final successful installation, that is, download the mysql source code in Ubuntu10.10, compile and install it. The current mysql version is 5.5.20, and my system version is ubuntu10.101. download the source code: on the official website, select MySQLCommunityServer -- download and select sourceco.

The first time I installed MySQL on Linux (Ubuntu 10.10), I had to pay some twists and turns, and finally I had to figure out my ideas. Let's talk about how to install mysql in Ubuntu 10.10.

The current mysql version is 5.5.20 and my system version is ubuntu 10.10.

1. Download the source code:

On the official website,

Select MySQL Community Server -- download

Select sourcecode, the first few are what rpm, the last one is the package I think should be downloaded

Generic Linux (Architecture Independent), Compressed TAR Archive
5.5.20 23.2 M Download
(Mysql-5.5.20.tar.gz)

 

2. Download and decompress the package.

There is an installation instruction file: INSTALL-SOURCE

Open, which is the core installation step: (addSudoRun !)

# Preconfiguration setup first adds a user group
Shell> groupadd mysql
Shell> useradd-r-g mysql
# Beginning of source-build specific instructions
Shell> tar zxvf mysql-VERSION.tar.gz extract source package
Shell> cd mysql-VERSION switch to the source package directory
Shell> cmake. Execute cmake to generate the mk file (No cmake, sudo apt-get install cmake)
Shell> make Edit
Install shell> make install
# End of source-build specific instructions ----------- OK. The installation is complete.
# Postinstallation setup ---- configure mysql
Shell> cd/usr/local/mysql
Shell> chown-R mysql.
Shell> chgrp-R mysql.
Shell> scripts/mysql_install_db -- user = mysql --- execute the internal mysql installation (See the execution result below the Red Line)
Shell> chown-R root.
Shell> chown-R mysql data
# Next command is optional -- literal meaning: The following command is optional
Shells> cp support-files/my-medium.cnf/etc/my. cnfCopy the mysql configuration file
Shell> bin/mysqld_safe -- user = mysql &Start Database
# Next command is optional -- literal meaning: The following command is optional
Shell> cp support-files/mysql. server/etc/init. d/mysql. serverSet auto-start

Follow this to complete the installation.

3. After the installation and configuration are complete, go and have a look.

In the/usr/local/mysql directory, run

Root @ www.linuxidc.com-laptop:/usr/local/mysql #./bin/mysql-u root-S/tmp/mysql. sock-p

Normal logon, prompt:

  1. Server version:5.5.20-Log Source distribution
  2. Copyright (c)2000,2011, Oracle and/or its affiliates. All rights reserved.
  3. Oracle is a registered trademark of Oracle Corporation and/or its
  4. Affiliates. Other names may be trademarks of their respective
  5. Owners.
  6. Type'Help ;'Or'\ H' ForHelp. Type'\ C'To clear the current input statement.
  7. Mysql>

4. There is a gui tool on the official website. You can download it and try it out:

MySQL Workbench (GUI Tool)

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.