"MySQL source" source installation and start MySQL

Source: Internet
Author: User
Tags readline

--"MySQL source" source to install and start MySQL

--------------------------------------2014/08/19

Native Environment: UBUNTU12.04,FEDORA-17

MySQL version: 5.5.28

CMake version: 2.8.9

One. Download the latest version of the CMake, unzip the installation after the compilation.

sudo./configure--prefix=/usr/local/etc/cmake-2.8.9sudo makesudo make install
sudo ln-s/usr/local/etc/cmake-2.8.9/bin/cmake/usr/local/bin/cmake

Now you can use the CMake command!

If the following prompt appears, install g++ first.

---------------------------------------------CMake 2.8.9, Copyright 2000-2011 kitware, INC.C compiler on the This system is: CC---------------------------------------------Error when bootstrapping cmake:cannot find appropriate C + + compiler on This system. Please specify one using environment variable CXX. See Cmake_bootstrap.log for compilers attempted.---------------------------------------------Log of errors:/usr/ Local/src/cmake-2.8.9/bootstrap.cmk/cmake_bootstrap.log---------------------------------------------

Ubuntu under use

sudo apt-get install g++

Redhat Series under use

sudo yum install gcc-c++

Download the latest MySQL source package, unzip it, go to its directory with

sudo cmake-dcmake_install_prefix=/usr/local/etc/mysql-5.5.28 \  -dmysql_datadir=/usr/local/etc/mysql-5.5.28/ Data \   -dextra_charsets=all \  -ddefault_charset=utf8 \  -ddefault_collation=utf8_general_ci \-DMYSQL_ Tcp_port=3306-dmysql_unix_addr=/tmp/mysql.sock \  -dwith_innobase_storage_engine=1 \

# This is a one-line version, easy to paste
# Note: Here the path is/opt, if you want to be consistent with the above, please manually modify
# sudo cmake-dcmake_install_prefix=/opt/mysql-5.5.28-dmysql_datadir=/opt/mysql-5.5.28/data-dextra_charsets=all- Ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dmysql_tcp_port=3306-dmysql_unix_addr=/tmp/mysql.sock -dwith_innobase_storage_engine=1

sudo make
sudo make install

Install Libncurses5-dev If the following error occurs during compilation

--Could not find Curses (missing:  curses_library curses_include_path) CMake Error at cmake/readline.cmake:83 (messag E):  Curses Library not found.  Please install the appropriate package,      remove CMakeCache.txt and rerun CMake. On Debian/ubuntu, package name was Libncurses5-dev, on Redhat and derivates it was ncurses-devel. Call Stack (most recent call first):  cmake/readline.cmake:127 (find_curses)  cmake/readline.cmake:217 (mysql_ Use_bundled_libedit)  cmakelists.txt:268 (mysql_check_readline)--Configuring incomplete, Errors occurred!
sudo apt-get install Libncurses5-dev
#删除编译缓存信息
sudo rm-rf CMakeCache.txt

Create a database after compilation is complete

./scripts/mysql_install_db--user=root--basedir=/opt/mysql-5.5. /--datadir=/opt/mysql-5.5. /data/

Once the creation is complete, you can start the database.

./bin/mysqld_safe--defaults-file=/etc/my.cnf--datadir=/opt/mysql-5.5. /data/--basedir=/opt/mysql-5.5. /--port=20120 --user=root&

I do not know whether it is because of the latest version of the MySQL 5.7 limit, I use the Ignore permission table to log into the database, the password is modified to empty, and then restart Mysqld, and then the empty password login successfully.

Then the query and create the database operation, reported the following error:

ERROR 1820 (HY000): Must SET PASSWORD before executing this statement

By: Set Password=password (""), the problem can be resolved.

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.