Install MySQL source code in Debian and Debian MySQL source code

Source: Internet
Author: User

Install MySQL source code in Debian and Debian MySQL source code
Note: root permission is required.

One database installation 1 installation dependency
Cmake, g ++, libncurses5-dev
Install the SDK directly using apt-get install.


2. Create users and directories
Groupadd mysql # Add a user group
Useradd-r-g mysql # Add a user
Mkdir-p/usr/local/mysql # create the installation directory
Chown-R root: mysql/usr/local/mysql # The owner is root and the group is mysql
Mkdir-p/usr/local/mysql/data # create a data storage directory
Chown-R mysql: mysql/usr/local/mysql/data # The owner is mysql and the group is mysql.


3. Download the mysql source code
Download source file: wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.16.tar.gz
Unzip: tar zxvf mysql-5.6.16.tar.gz


4. Compile
Cd mysql-5.6.16
Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/usr/local/mysql/data
Make & make install
Note: If you re-compile
Make clean & rm CMakeCache.txt


Database 2 configuration 1 initialize Database
Cp support-files/my-default.cnf/etc/my. cnf # change the configuration file location
Scripts/mysql_install_db -- user = mysql # Install a database
Cp support-files/mysql. server/etc/init. d/mysql # Add the mysql startup service to the system service.
Service mysqld start # start the database


2. Set the root user
/Usr/local/mysql/bin/mysql-uroot-p123456 # Set the root user and password
Mysql> grant all privileges on *. * TO root @ "%" identified by "root"; # Add the remote connection capability TO the root user.
Mysql> UPDATE user SET Password = password ('000000') WHERE User = 'root'; # SET the Password
Mysql> SELECT Host, User, Password FROM user; # verify
Mysql> flush privilegs;

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.