Install MySQL 5.5.35 in the source code of Ubuntu 14.04

Source: Internet
Author: User

Install MySQL 5.5.35 in the source code of Ubuntu 14.04

The Ubuntu-14.04-desktop-amd64 is installed. During this process, I made a low-level error. When I installed the partition in Ubuntu, I divided the partition in free space. However, the windows partition Ubuntu is not mounted, that is to say, free partitioning refers to the entire hard disk. As a result, the original boot, Windows 7, and all data are gone. Here we also remind everyone to be cautious about partitioning. After reading this, confirm the next step. For more information about Windows 7 + Ubuntu dual-system installation, follow

Let's talk about installing Ubuntu14.04 source code. Some minor changes have been made to the source code installation of the mysql5.X series. configure is no longer used for source code compilation, but cmake is used. Follow the steps below.

1. preparation.

1.1 install cmake

Apt-get install cmake

1.2 install libncurses5-dev

Apt-get install libncurses5-dev

1.3 install bison

Apt-get install bison

1.4 install g ++

Apt-get install g ++

1.5 download the mysql5.5.35 source code package

Web: http://dev.mysql.com/downloads/mysql/5.5.html#downloads

Here, some friends say that the downloaded tar package cannot be used. It is actually an error in the Source package. Check that the Source Code must be selected in select platform, download the following tar package.

2. Installation

2.1 decompress the mysql source code package. I downloaded the source code package to/home/user name/download/and decompressed it to the same directory.

Tar zxvf mysql-5.5.35.tar.gz

If you want to decompress the package to a specified directory, add "-C path ".

2.2 cmake source code

Cmake. \-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \-DINSTALL_DATADIR =/usr/local/mysql/data \-DMYS
QL_UNIX_ADDR =/usr/local/mysql/mysqld. sock \-DDEFAULT_CHARSET = utf8 \-DDEFAULT_COLLATION = utf8_gene
Ral_ci \-DEXTRA_CHARSETS = all \-DENABLED_LOCAL_INFILE = 1
 

(The layout is a bit problematic here. Let's take a look)

I put the installation path under/usr/local/mysql, that is, the default path, and data under/usr/local/mysql/data, put the sock file in/usr/local/mysql/mysqld. sock

Some parameters are as follows: select as needed.

CMAKE_INSTALL_PREFIX: Specifies the installation directory of the MySQL program. The default value is/usr/local/mysql.
DEFAULT_CHARSET: Specifies the default Character Set of the server. The default value is latin1.
DEFAULT_COLLATION: Specifies the default server verification rules. The default value is latin1_general_ci.
ENABLED_LOCAL_INFILE: Specifies whether local load data infile execution is allowed. The default value is OFF.
WITH_COMMENT: Specifies the compilation remarks.
WITH_xxx_STORAGE_ENGINE: it specifies the storage engine for static compilation to mysql. By default, four engines, MyISAM, MERGE, MEMBER, and CSV, are compiled to the server, and do not need to be specified.
WITHOUT_xxx_STORAGE_ENGINE: Specifies the storage engine that is not compiled.
SYSCONFDIR: directory of the initialization parameter file
MYSQL_DATADIR: data file directory
MYSQL_TCP_PORT: Service port number. The default value is 3306.
MYSQL_UNIX_ADDR: socket file path. Default Value:/tmp/mysql. sock

2.3 make & make install

If cmake reports an error, check the directory permission, mysql group, and user. Generally, I have created a mysql user group in advance. If no error is reported, you can perform this step.

Make
Make install

3. Configuration

3.1 after installation is complete, enter the installation directory and put the configuration file under/etc.

Cp surpport-files/my-medium.cnf/etc/my. cnf

3.2 initialize the database

Scripts/mysql_install_db -- user = mysql

After the execution is successful, you will see

Then run the following command:

Cp surpport-files/mysql. server/rtc/init. d/mysql
Chmod 755/etc/init. d/mysql

3.3 let's start the mysql service for a try.

/Etc/init. d/mysql start

3.4 create the root user password after successful startup (the path is the bin in the installation directory)

Bin/mysqladmin-u root password '*******'

3.5 after the previous step is successful, let's use it now.

Bin/mysql-uroot-p

The general installation process of mysql5.5.35 under Ubuntu14.04 is as follows. There are also many problems during installation. Check the error prompt carefully, check more information, and analyze more. In fact, the problem is very simple.

Okay, it's over. Thank you.

PS: You can add the commands in the bin directory to the PATH so that you do not need to enter the directory every time to start mysql. Other skills will be available in the future. Goodbye.

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.