[Install MySQL under Linux]linux

Source: Internet
Author: User

1, installation g++
$sudo Apt-get Install Build-essential
Note: This command installs both GCC and make
2, installation CMake
$sudo Apt-get Install CMake
3. Install MySQL
Enter the directory where the MySQL file is located (CD)
$unzip mysql-5.6.4-m7.tar\ (1\). zip
$tar-ZXVF mysql-5.6.4-m7.tar.gz
Enter MYSQL-5.6.4-M7
$CD MYSQL-5.6.4-M7
$groupadd MySQL//So here we're going to build a MSYQL user and group
$useradd-G MySQL mysql-s/usr/sbin/nologin
$mkdir/usr/local/mysql//Create a directory
$mkdir/usr/local/mysql/data
$cmake-dcmake_install_prefix=/usr/local/mysql && make && make INSTALL
At this point can be error, the lack of ncurses library, such as, enter the following command to install
$sudo Apt-get Install Libncurses5-dev
Then delete the CMakeCache.txt in the directory
$sudo RM CMakeCache.txt
Continue operation input Cmake-dcmake .... This command was successfully installed.
4. Configure MySQL
Enter MySQL under the installation directory/usr/local/mysql:
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql//Initialize MySQL database
CP support-files/my-medium.cnf/usr/local/mysql/my.cnf//copy configuration file
Chown-r mysql:mysql/usr/local/mysql//Change permissions
VI/USR/LOCAL/MYSQL/MY.CNF//Add the following content

[Mysqld]
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Log-error =/usr/local/mysql/mysql_error.log
Pid-file =/usr/local/mysql/mysql.pid
user = MySQL
Tmpdir =/tmp

Start MySQL bin/mysqld_safe--user=mysql & or use the following command to add MySQL as a system service.
cd/usr/local/mysql/support-files/
CP./mysql.server/etc/init.d/mysqld
/etc/init.d/mysqld start

[Install MySQL under Linux]linux

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.