4 编译
cd mysql-5.6.16
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data
make && make install
注:如果重新编译
make clean && rm CMakeCache.txt
2 设置root用户
/usr/local/mysql/bin/mysql -uroot -p123456 # 设置root用户和密码
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root"; # 为root添加远程连接的能力。
mysql> UPDATE user SET Password = password(‘123456’) WHERE User=‘root‘; # 设置密码
mysql> SELECT Host,User,Password FROM user; # 验证一下
mysql> flush privilegs;