Source Mode installation mysql5.5

Source: Internet
Author: User
Tags readline mysql login

mysql5.5 start, the source Configuration compiler tool Configure become cmake, so first to go to the cmake installed. and install the make,bison,cmake,gcc-c++,ncurses package

Go to http://www.cmake.org/cmake/resources/software.html download CMake

./cmake-2.8.12.2-linux-i386.sh--prefix=/usr/local/

Ln-s/usr/local/cmake-2.8.12.2-linux-i386/bin/cmake/usr/bin/cmake

Execute # cmake first.-LH Check the CMake to see the supported parameters, or go to http://dev.mysql.com/doc/refman/5.5/en/ source-configuration-options.html View A detailed description of the parameters that can be specified at compile time, you can also refer to this section of the installation documentation: 2.9.4 MySQL source-configuration options.

Common parameters are as follows:

Cmake_install_prefix: Specify the installation directory for the MySQL program, default/usr/local/mysqldefault_charset: Specify the server default character set, default Latin1default_ COLLATION: Specifies the default proofing rules for the server, default Latin1_general_cienabled_local_infile: Specifies whether to allow load DATA INFILE to be executed locally, by default Offwith_ COMMENT: Specifies compile note Information with_xxx_storage_engine: Specifies the storage engine that is statically compiled to MySQL, Myisam,merge,member and CSV Four engines are compiled to the server by default and do not require special designation. Without_xxx_storage_engine: Specify a storage engine that does not compile Sysconfdir: Initialize parameter file directory mysql_datadir: Data file directory mysql_tcp_port: Service port number, default 3306mysql_ Unix_addr:socket file path, default /tmp/mysql.sock

The parameters specified when actually executed are as follows:

CMake. -dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/usr/local/mysql/data-dsysconfdir=/etc- ddefault_charset=UTF8-ddefault_collation=utf8_general_ci-dmysql_user=mysql
[Email protected] mysql-5.5.Panax Notoginseng]# CMake. -dcmake_install_prefix=/u01/mysql-dmysql_datadir=/u01/mysql/mysql/data-dsysconfdir=/etc>-ddefault_charset=GBK>-ddefault_collation=Gbk_general_ci>-dmysql_user=MySQL--Running CMake version2.6.4--MySQL5.5.Panax Notoginseng--Packaging as:mysql-5.5.Panax Notoginseng-linux-x86_64--Could notFindCurses (missing:curses_library curses_include_path) CMake Error at CMake/readline.cmake: the(MESSAGE): Curses library not found. pleaseInstallappropriate package, remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name was Libncurses5-dev, on Redhat and derivates it's ncurses-devel. Call Stack (most recent call first): CMake/readline.cmake:127(find_curses) CMake/readline.cmake:217(Mysql_use_bundled_libedit) CMakeLists.txt:355(Mysql_check_readline)--Configuring incomplete, Errors occurred!

CMake process, reported a fault, according to the prompt to install Ncurses-devel, and find/-name CMakeCache.txt, put out the list of deleted points, re-cmake on the line.

and then make.

Then perform the Make install

after the compilation is complete, install the database

[Email protected] mysql]#lsbin COPYING data docs include INSTALL-binary LibMansMysql-test README Scripts Share Sql-bench support-Files[[email protected] mysql]# CD scripts/[email protected] scripts]#lsMysql_install_db[[email protected] scripts]#./mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/datainstalling MySQL system tables ... Okfilling Help Tables ... OKto start mysqld at boot TimeYou have to Copysupport-files/mysql.server to the right place foryour systemplease REMEMBER to SET A PASSWORD for the MySQL root USER! to DoSo, start the server, Thenissue the following commands:/usr/local/mysql/bin/mysqladmin-u Root Password'New-password'/usr/local/mysql/bin/mysqladmin-u root-h ora11g Password'New-password'Alternatively you can run:/usr/local/mysql/bin/mysql_secure_installationwhichWould also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended forproduction servers. See the manual for  Moreinstructions. You can start the MySQL daemon with:cd/usr/local/mysql; /usr/local/mysql/bin/mysqld_safe &can test the MySQL daemon with MySQL-test-RUN.PLCD/usr/local/mysql/mysql-test;Perlmysql-test-Run.plplease Report any problems at http://bugs.mysql.com/[email protected] scripts]#

This step can also first modify the template inside the Support-files, add--basedir=/usr/local/mysql in the template--datadir=/usr/local/mysql/data

If you do not add Basedir and DataDir, the initialization will error:

[Email protected] scripts]#./mysql_install_db  --defaults-file=: /MY.CNF--user=mysql                 find /bin/'makeinstall'   for  --basedir option

Executed under the bin, mysql_install_db--default-file=my.cnf--user=mysql

MySQL Startup:

[Email protected] ~]$CD/usr/local/mysql/bin/[[email protected] bin]$ ./mysqldmysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow [[email protected] bin]$./mysqld_safe--user=MySQL &[1] 2244[[email protected] bin]$140327 21:17:41 mysqld_safe Logging to '/usr/local/mysql/data/ora11g.err '. 140327 21:17:41 mysqld_safe Starting mysqld D Aemon with Databases from/usr/local/mysql/Data[[email protected] bin]$[[email protected] bin]$ps-ef | grep mysqlroot2082 1786 0 21:17 pts/2 00:00:00Su-mysqlmysql2083 2082 0 21:17 pts/2 00:00:00-bashmysql2244 2083 0 21:17 pts/2 00:00:00/bin/sh./mysqld_safe--user=Mysqlmysql2496 2244 1 21:17 pts/2 00:00:00/usr/local/mysql/bin/mysqld--basedir=/usr/local/mysql--datadir=/usr/local/mysql/da Ta--plugin-dir=/usr/local/mysql/lib/plugin--log-error=/usr/local/mysql/data/ora11g.err--pid-file=/usr/local/mysql/data/ Ora11g.pid--socket=/tmp/mysql.sock--port=3306MySQL2579 2083 0 21:17 pts/2 00:00:00Ps-efmysql2580 2083 0 21:17 pts/2 00:00:00grep mysql[[email protected] bin]$

MySQL Login:

[Email protected] bin]$.Mysqlwelcome to the MySQL Monitor. Commands End With; or\g.your MySQL Connection ID is1Server Version:5.5.37Source Distributioncopyright (c)A, Oracle and/orIts affiliates. All rights reserved. Oracle isA registered trademark of Oracle Corporation and/oritsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;' or '\h'  forHelp. Type'\c'To clear the current input statement.mysql>show databases;+--------------------+| Database |+--------------------+| Information_schema | | MySQL | | Performance_schema | | Test |+--------------------+4 rowsinchSet (0.00sec)MySQL>select version ();+-----------+| Version () |+-----------+| 5.5.37 |+-----------+1 rowinchSet (0.00sec) MySQL>

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.