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