mysql5.5 more than version compilation requires CMake
1 Installing CMake
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
TAR-ZXVF cmake-2.8.10.2.tar.gz
CD CD cmake-2.8.10.2
./configure
Make
Make install
To this cmake installation is complete
2 Installing MySQL
Check if MySQL is already installed
Rpm-qa | grep MySQL (if it is already installed, you need to uninstall it first)
RPM-E--nodeps mysql-libs-5.1.61-4.el6.x86_64 (uninstall MySQL)
Groupadd MySQL (add MySQL user group)
Useradd-g mysql-s/sbin/nologin MySQL (added MySQL user does not allow direct login)
TAR-ZXVF mysql-5.6.13.tar.gz
CD mysql-5.6.13
CMake.
-dcmake_install_prefix=/usr/local/mysql
-dmysql_datadir=/usr/local/mysql/data
-ddefault_charset=utf8
-ddefault_collation=utf8_general_ci
-dextra_charsets=all
-denabled_local_infile=1 (cmake compile MySQL)
Make
Make install
Make clean
Chown-r Mysql:mysql/usr/local/mysql
(Requires chmod 755 scripts/mysql_install_db assignment to file execution rights before execution)
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
chmod 755/etc/init.d/mysql
Chkconfig--add mysqld
Chkconfig mysqld on
Service mysqld Restart
Add to environment variable
Vi/etc/profile
Add the following code export path= "$PATH:/usr/local/mysql/bin"
Source/etc/profile
Log in to MySQL
MYSQL-UROOT-P//Login MySQL does not need to enter the password for the first time landing
Use MySQL;
Delete from user where user= '; Delete a user with a blank user name
UPDATE user SET Password=password ("123456") WHERE user= ' root '; To modify the root user's password
MySQL Add user's command
Grant all privileges the db_test.* to [email protected] "%" identified by ' 123456 ' with GRANT option;
This adds a Db_user user action to the database db_test the default password is 123456
Flush privileges;//Refresh Permissions
CentOS 5.8 64-bit system installation mysql5.6.1