Install MySQL 5.1.34 in Ubuntu 10.10 source code

Source: Internet
Author: User

Recently, I have re-installed the Ubuntu 10.10 system and need to re-compile and install Mysql. The source code version is 5.1.34.

It's a tough task. I don't know what the 10.10 system has changed, and the software installation is so bad.

Here we record all the problems:

The procedure is as follows:

++ ++ ++

1. Install the compilation tool under Ubuntu 10.10

Sudo apt-get install build-tials

The gcc and g ++ versions after installation are both (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

++ ++ ++

2../configure -- prefix =/usr/local/mysql

++ ++ ++

3. make

An error occurred during make. The last few lines are as follows:

Make [2]: *** [do_abi_check] Error 1

Make [2]: Leaving directory '/home/ice/Documents/software/mysql/src/mysql-5.1.34'

Make [1]: *** [abi_check] Error 2

Make [1]: Leaving directory '/home/ice/Documents/software/mysql/src/mysql-5.1.34'

Make: *** [all-recursive] Error 1

Reference http://bugs.mysql.com/bug.php? Id = 52514. comment out the last do_abi_check in Makefile.

Skip ABI Check

Make again

++ ++ ++

4. sudo make install successfully passed

++ ++ ++

5. Run the following command in the directory/usr/local/mysql (ice is my username)


Chown-R ice.

Chgrp-R ice.

++ ++ ++

6. Run mysql_install_db -- basedir =/usr/local/mysql \ in the directory/usr/local/bin \

-- Datadir =/usr/local/mysql/data

++ ++ ++

7. Switch to the libexec directory.

-------------------------------------------------------

Run the command./mysqld to generate the following error:

101215 10:09:07 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg. sys'

The cause of the problem should be that you have not defined a my. cnf configuration file. If you do not configure your own configuration file, the system will use the default configuration and then generate the above error.

Copy my_small.cnf in the support_files folder in the source code to/etc/my. cnf and add a parameter

Language =/usr/local/mysql/share/mysql/english

--------------------------------------------------------

An error occurred while running./mysqld:

101215 2:25:47 [Warning] Can't create test file/var/lib/mysql/ice-ThinkPad-R400.lower-test

101215 2:25:47 [Warning] Can't create test file/var/lib/mysql/ice-ThinkPad-R400.lower-test

./Mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)

101215 2:25:47 [ERROR] Aborting

101215 2:25:47 [Note]./mysqld: Shutdown complete

No reason found, refer to official documentation http://dev.mysql.com/doc/refman/5.1/en/starting-server.html

There is a saying in the middle: When the mysqld server starts, it changes location to the data directory.

So it is estimated that the above error is because the datadir parameter is not specified. The default data folder of the system is in the original directory of/var/lib/mysql /.

Run the command again./mysqld -- datadir =/usr/local/mysql/data

The above error is missing.

Add this parameter to the/etc/my. cnf configuration file.

--------------------------------------------------------

The following error occurs when running./mysqld.

101215 11:12:31 [ERROR] Can't start server: Bind on unix socket: No such file or directory

101215 11:12:31 [ERROR] Do you already have another mysqld server running on socket:/var/run/mysqld. sock?

101215 11:12:31 [ERROR] Aborting

Tangle, how to keep making mistakes, continue searching online and finally find the root cause of the problem

In Ubuntu, there is also such a configuration file/etc/mysql/my. cnf

The file contains the following lines:

User = mysql

Socket =/var/run/mysqld. sock

Port = 3306

Basedir =/usr

Datadir =/var/lib/mysql

Tmpdir =/tmp

This configuration file is carried by the system itself. Many of the above problems have been caused by this hidden configuration file. Alas, after a long time, I finally found the root cause of the problem!

Change/etc/mysql/my. cnf to/etc/mysql/my. cnf. backup

Run again./mysqld

101215 11:54:11 [Note] Event schedents: Loaded 0 events

101215 11:54:11 [Note]./mysqld: ready for connections.

Version: '5. 1.34 'socket:'/tmp/mysql. sock 'port: 3306 Source distribution

Ready for connections is finally successful! Congratulations!

-----------------------------------------------------------------

Note: the reason for these many problems is that gcc4.3 was upgraded to gcc4.4 and compiled with gcc4.4. Not only does ABI_CHECK have problems, after the installation, some tests provided by mysql still fail. After the compiler is reduced to gcc4.3 and g ++ 4.3, the problem of ABI_CHECK failure will not occur during source code installation, after compilation, all tests can be passed.

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.