MySQL source installation under Debian

Source: Internet
Author: User

Note: Root privileges are required

One database installation 1 installation dependent
CMake, g++, Libncurses5-dev
Use Apt-get install directly


2 Creating good users and directories
Groupadd MySQL # Add user group
Useradd-r-G MySQL MySQL # Add user
Mkdir-p/usr/local/mysql # Creating the installation directory
Chown-r Root:mysql/usr/local/mysql # Owner is root, owning group is MySQL
Mkdir-p/usr/local/mysql/data # Create a data store directory
Chown-r Mysql:mysql/usr/local/mysql/data # Owner is MySQL, owning group is MySQL


3 download MySQL original code
Download source files: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz
Decompression: Tar zxvf mysql-5.6.16.tar.gz


4 compiling
CD mysql-5.6.16
Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/usr/local/mysql/data
Make && make install
Note: If you recompile
Make Clean && rm CMakeCache.txt


Two database configuration 1 initializing the database
CP support-files/my-default.cnf/etc/my.cnf # Changing the configuration file location
scripts/mysql_install_db--user=mysql # Installing the database
CP Support-files/mysql.server/etc/init.d/mysql #将mysql的启动服务添加到系统服务中
Service mysqld Start # Startup database


2 Setting up the root user
/usr/local/mysql/bin/mysql-uroot-p123456 # Set root user and password
Mysql> GRANT All privileges on * * to [email protected] '% ' identified by ' root '; # The ability to add remote connections for root.
mysql> UPDATE user SET Password = Password (' 123456 ') WHERE user= ' root '; # Set Password
Mysql> SELECT Host,user,password from User; # verify
mysql> Flush Privilegs;

MySQL source installation under Debian

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.