Linux编译安装mysql5.7.9数据库
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[root@Lnmp mysql-5.7.9]# yum install bison pcre* openssl* openssl-devel gcc gcc-c++ cmake libaio* library* ncurses-* -y [root@Lnmp ~]# cd /byrd/tools/ [root@Lnmp tools]# wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.9.tar.gz [root@Lnmp tools]# tar zxf mysql-5.7.9.tar.gz [root@Lnmp tools]# groupadd mysql [root@Lnmp tools]# useradd -s /sbin/nologin -g mysql mysql [root@Lnmp tools]# cd mysql-5.7.9 [root@Lnmp mysql-5.7.9]# cmake . -DCMAKE_INSTALL_PREFIX=/byrd/service/mysql-5.7.9 -DMYSQL_DATADIR=/byrd/service/mysql-5.7.9/data -DMYSQL_UNIX_ADDR=/byrd/service/mysql-5.7.9/tmp/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=ON -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost [root@Lnmp mysql-5.7.9]# make [root@Lnmp mysql-5.7.9]# make install [root@Lnmp mysql-5.7.9]# ln -s /byrd/service/mysql-5.7.9 /usr/local/mysql [root@Lnmp mysql-5.7.9]# /byrd/service/mysql-5.7.9/bin/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=mysql #mysql_install_db is deprecated. Please consider switching to mysqld --initialize [root@Lnmp mysql-5.7.9]# /byrd/service/mysql-5.7.9/bin/mysqld --initialize [root@Lnmp mysql-5.7.9]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld [root@Lnmp mysql-5.7.9]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf [root@Lnmp mysql-5.7.9]# /etc/init.d/mysqld start [root@Lnmp mysql-5.7.9]# netstat -tunlp|grep mysqld tcp 0 0 :::3306 :::* LISTEN 6002/mysqld [root@Lnmp mysql-5.7.9]# cat /root/.mysql_secret # Password set for user 'root@localhost' at 2015-11-03 10:14:25 lBpeSgnqh<tD [root@Lnmp mysql-5.7.9]# /usr/local/mysql/bin/mysql -uroot -p'lBpeSgnqh<tD' [root@Lnmp mysql-5.7.9]# /usr/local/mysql/bin/mysqladmin -uroot -p'lBpeSgnqh<tD' password 'admin456' [root@Lnmp mysql-5.7.9]# /usr/local/mysql/bin/mysql -uroot -p'admin456' mysql> update mysql.user set authentication_string=password('123456789') where user='root' and Host = 'localhost'; Query OK, 1 row affected, 1 warning (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> update mysql.user set password=PASSWORD('123456') where user='root'; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> SET PASSWORD = PASSWORD('123456'); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) [root@Lnmp mysql-5.7.9]# /usr/local/mysql/bin/mysql -uroot -p'123456789' mysql> quit; |
问题帮助文档:
一、http://note.t4x.org/error/cmake-error-at-boost-message/
二、http://note.t4x.org/error/cmake-error-at-cmake177-message/SourceByrd's Weblog-https://note.t4x.org/environment/linux-configure-mysql579/
SourceByrd's Weblog-https://note.t4x.org/environment/linux-configure-mysql579/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!