1、安装相关依赖包
yum-yinstallgcc*autoconfautomakezlib*fiex*libxml*ncurses-devellibmcrypt*libmcrypt*libtool-ltdl-devel*
2、需要安装个包
安装cmake
root@localhostsrc]#tarzxvfcmake-2.8.5.tar.gz
[root@localhostsrc]#cdcmake-2.8.5
[root@localhostcmake-2.8.5]#./bootstrap
…………
--Buildfileshavebeenwrittento:/usr/local/src/cmake-2.8.5
---------------------------------------------
CMakehasbootstrapped.Nowrungmake.
gmake
[100%]BuildingCXXobjectTests/CMakeLib/CMakeFiles/runcompilecommands.dir/run_compile_commands.cxx.o
LinkingCXXexecutableruncompilecommands
[100%]Builttargetruncompilecommands
gmakeinstall
cd..
安装mysql5.7.11
groupaddmysql
useradd-gmysqlmysql
tarzxvfmysql-5.7.11.tar.gz
cdmysql-5.7.11
[root@localhostmysql-5.7.11]#
cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DEXTRA_CHARSETS=all\
-DWITH_EXTRA_CHARSETS:STRING=utf8,gbk\
-DWITH_MYISAM_STORAGE_ENGINE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_MEMORY_STORAGE_ENGINE=1\
-DWITH_READLINE=1\
-DENABLED_LOCAL_INFILE=1\
-DMYSQL_DATADIR=/var/mysql/data\
-DMYSQL_USER=mysql\
-DDOWNLOAD_BOOST=1\
-DWITH_BOOST=/usr/local/boost/boost_1_59_0
CMakeWarning:
Manually-specifiedvariableswerenotusedbytheproject:
MYSQL_USER
WITH_MEMORY_STORAGE_ENGINE
--Buildfileshavebeenwrittento:/usr/local/src/mysql-5.7.11
[root@localhostmysql-5.7.11]#make
[100%]BuildingCXXobjectmysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
LinkingCXXexecutablemy_safe_process
[100%]Builttargetmy_safe_process
makeinstall
--Installing:/usr/local/mysql/man/man1/mysql_find_rows.1
--Installing:/usr/local/mysql/man/man1/mysql_upgrade.1
--Installing:/usr/local/mysql/man/man1/mysqlimport.1
--Installing:/usr/local/mysql/man/man1/mysql_client_test.1
--Installing:/usr/local/mysql/man/man8/mysqld.8
chmod+w/usr/local/mysql/
chown-Rmysql:mysql/usr/local/mysql/
ln-s/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib/libmysqlclient.so.18
mkdir-p/var/mysql
mkdir-p/var/mysql/log/
chown-Rmysql:mysql/var/mysql/
cdsupport-files/
[root@localhostsupport-files]#cpmy-medium.cnf/etc/my.cnf
cpmysql.server/etc/init.d/mysql
[root@localhostsupport-files]#vim /etc/my.cnf
[mysqld] #Removeleading#andsettotheamountofRAMforthemostimportantdata #cacheinMySQL.Startat70%oftotalRAMfordedicatedserver,else10%. #innodb_buffer_pool_size=128M #Removeleading#toturnonaveryimportantdataintegrityoption:logging #changestothebinarylogbetweenbackups. #log_bin=mysql-bin #Thesearecommonlyset,removethe#andsetasrequired. basedir=/usr/local/mysql datadir=/var/mysql/data port=3306 #server_id=..... socket=/tmp/mysql.sock #defaults-file=/etc/my.cnf explicit_defaults_for_timestamp=true
初始化mysql:
/usr/local/mysql/bin/mysqld--initialize-insecure--user=mysql--basedir=/usr/local/mysql--datadir=/var/mysql/data
YoucanstarttheMySQLdaemonwith:
cd/usr/local/mysql;/usr/local/mysql/bin/mysqld_safe&
YoucantesttheMySQLdaemonwithmysql-test-run.pl
cd/usr/local/mysql/mysql-test;perlmysql-test-run.pl
Pleasereportanyproblemswiththe/usr/local/mysql/scripts/mysqlbugscript!
chmod+x/etc/init.d/mysql
vi/etc/init.d/mysql
basedir=/usr/local/mysql
datadir=/var/mysql/data
chkconfig--addmysql
chkconfig--level345mysqlon
cd/usr/local/mysql
[root@localhostmysql]#servicemysqlstart
StartingMySQL..SUCCESS!
mysql
-bash:mysql:commandnotfound
/usr/local/mysql/bin/mysql-urootmysql
mysql>showdatabases;
+--------------------+
|Database|
|information_schema|
|mysql|
|performance_schema|
|test|
4rowsinset(0.01sec)
mysql>exit
Bye
ln-s/usr/local/mysql/bin/mysql/usr/bin
ln-s/usr/local/mysql/bin/mysqladmin/usr/bin
mysql
showdatabases;
4rowsinset(0.00sec)
grantallprivilegeson*.*toroot@'%'identifiedby'123456'withgrantoption;
QueryOK,0rowsaffected(0.00sec)
flushprivileges;
/etc/init.d/iptablesstop;
Flushingfirewallrules:[OK]
SettingchainstopolicyACCEPT:filter[OK]
Unloadingiptablesmodules:[OK]
开启端口3306的访问:
sbin/iptables-IINPUT-ptcp--dport3306-jACCEPT
serviceiptablessave
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。