mysql 5.7.19 二进制最新安装
首先从官网下载ziparchive版本http://dev.mysql.com/downloads/mysql/
MySQLv5.7.19官方正式版(32/64位安装版与zip解压版)
一、优化部分
1.操作系统参数调优
2.数据库参数调优
3.防火墙设置等
#############################
二、安装部分
1.创建用户和组
#groupaddmysql #useradd-gmysqlmysql
2.创建数据库安装目录、授权
#mkdir/mysql/mysql/data/mysql/log #chown-Rmysql:mysql/usr/local/mysql
3.到安装目录,解压安装文件
#cd/usr/local #tar-zxvfmysql-5.7.19-linux-glibc2.12-x86_64.tar.gz #mvmysql-5.7.19-linux-glibc2.12-x86_64mysql
4.授权
#chown-Rmysql.mysqlmysql
5.验证权限
#ls-lmysql total52 drwxr-xr-x2mysqlmysql4096Aug804:06bin -rw-r--r--1mysqlmysql17987Jun2222:13COPYING drwxr-xr-x2mysqlmysql4096Aug804:06docs drwxr-xr-x3mysqlmysql4096Aug804:06include drwxr-xr-x5mysqlmysql4096Aug804:06lib drwxr-xr-x4mysqlmysql4096Aug804:06man -rw-r--r--1mysqlmysql2478Jun2222:13README drwxr-xr-x28mysqlmysql4096Aug804:06share drwxr-xr-x2mysqlmysql4096Aug804:06support-files
6.编辑参数文件
vim/etc/my.cnf [client] port=3306 socket=/tmp/mysql.sock [mysqld] server_id=10 port=3306 user=mysql character-set-server=utf8mb4 default_storage_engine=innodb log_timestamps=SYSTEM socket=/tmp/mysql.sock basedir=/usr/local/mysql datadir=/mysql/data pid-file=/mysql/data/mysql.pid max_connections=1000 max_connect_errors=1000 table_open_cache=1024 max_allowed_packet=128M open_files_limit=65535 #####====================================[innodb]============================== innodb_buffer_pool_size=1024M innodb_file_per_table=1 innodb_write_io_threads=4 innodb_read_io_threads=4 innodb_purge_threads=2 innodb_flush_log_at_trx_commit=1 innodb_log_file_size=512M innodb_log_files_in_group=2 innodb_log_buffer_size=16M innodb_max_dirty_pages_pct=80 innodb_lock_wait_timeout=30 innodb_data_file_path=ibdata1:1024M:autoextend innodb_undo_tablespaces=3 #####====================================[log]============================== log_error=/mysql/log/mysql-error.log slow_query_log=1 long_query_time=1 slow_query_log_file=/mysql/log/mysql-slow.log sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
7.安装数据库
#./bin/mysqld--initialize--user=mysql--basedir=/usr/local/mysql--datadir=/mysql/data--innodb_undo_tablespaces=3--explicit_defaults_for_timestamp
8.配置启动文件
cpsupport-files/mysql.server/etc/init.d/mysql chkconfig--addmysql chkconfigmysqlon servicemysqlstart
9.配置环境变量
vi/etc/profile #formysql mysql_home=/usr/local/mysql PATH=$PATH:$mysql_home/bin source/etc/profile
10.查看默认密码
grep-ipassword/mysql/log/mysql-error.log
11.初始化密码
mysql-uroot-p‘xxxxx‘ SETPASSWORD=PASSWORD(‘root‘); flushprivileges;
12.数据库常规启停
#mysqladmin-uroot-prootshutdown #mysqld_safe--defaults-file=/etc/my.cnf& #ps-ef|grepmysql
13.安全配置
#mysql_secure_installation SecuringtheMySQLserverdeployment. Enterpasswordforuserroot: VALIDATEPASSWORDPLUGINcanbeusedtotestpasswords andimprovesecurity.Itchecksthestrengthofpassword andallowstheuserstosetonlythosepasswordswhichare secureenough.WouldyouliketosetupVALIDATEPASSWORDplugin? Pressy|YforYes,anyotherkeyforNo:y Therearethreelevelsofpasswordvalidationpolicy: LOWLength>=8 MEDIUMLength>=8,numeric,mixedcase,andspecialcharacters STRONGLength>=8,numeric,mixedcase,specialcharactersanddictionaryfile Pleaseenter0=LOW,1=MEDIUMand2=STRONG:2 Usingexistingpasswordforroot. Estimatedstrengthofthepassword:25 Changethepasswordforroot?((Pressy|YforYes,anyotherkeyforNo):y Newpassword: Re-enternewpassword: Sorry,passwordsdonotmatch. Newpassword: Re-enternewpassword: Sorry,passwordsdonotmatch. Newpassword: Re-enternewpassword: Estimatedstrengthofthepassword:50 Doyouwishtocontinuewiththepasswordprovided?(Pressy|YforYes,anyotherkeyforNo):y ...Failed!Error:Yourpassworddoesnotsatisfythecurrentpolicyrequirements Newpassword: Re-enternewpassword: Estimatedstrengthofthepassword:100 Doyouwishtocontinuewiththepasswordprovided?(Pressy|YforYes,anyotherkeyforNo):y Bydefault,aMySQLinstallationhasananonymoususer, allowinganyonetologintoMySQLwithouthavingtohave auseraccountcreatedforthem.Thisisintendedonlyfor testing,andtomaketheinstallationgoabitsmoother. Youshouldremovethembeforemovingintoaproduction environment. Removeanonymoususers?(Pressy|YforYes,anyotherkeyforNo):y Success. Normally,rootshouldonlybeallowedtoconnectfrom ‘localhost‘.Thisensuresthatsomeonecannotguessat therootpasswordfromthenetwork. Disallowrootloginremotely?(Pressy|YforYes,anyotherkeyforNo):y Success. Bydefault,MySQLcomeswithadatabasenamed‘test‘that anyonecanaccess.Thisisalsointendedonlyfortesting, andshouldberemovedbeforemovingintoaproduction environment. Removetestdatabaseandaccesstoit?(Pressy|YforYes,anyotherkeyforNo):y -Droppingtestdatabase... Success. -Removingprivilegesontestdatabase... Success. Reloadingtheprivilegetableswillensurethatallchanges madesofarwilltakeeffectimmediately. Reloadprivilegetablesnow?(Pressy|YforYes,anyotherkeyforNo):y Success. Alldone!
相关阅读:
Mysql在各个系统的安装教程
Mysql5.7.19免安装版配置方法教程详解(64位)
Mysql5.7.19免安装版遇到的坑(收藏)
MySQL5.7.19安装目录下创建my.ini文件的方法
总结
以上所述是小编给大家介绍的mysql5.7.19二进制最新安装,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!