MySQL 5.7.22 二進(jìn)制包安裝及免安裝版Windows配置方法
下面通過(guò)代碼給大家介紹了mysql 5.7.22 二進(jìn)制包安裝方法,具體代碼如下所示:
.目錄規(guī)劃: 程序目錄:/usr/local/mysql 數(shù)據(jù)目錄:/data/mysql PID和SOCKET文件位置:/tmp .文件下載: 官方默認(rèn)只提供最新版本的,歷史版本的下載地址: https://downloads.mysql.com/archives/ .7.22版本下載: # wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz 文件下載大小約614M。 #tar -xzf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz -C /usr/local/ #mv /usr/local/mysql-5.7.22-linux-glibc2.12-x86_64/ /usr/local/mysql # echo "export PATH=$PATH:/usr/local/mysql/bin" >/etc/profile.d/mysql.sh # source /etc/profile.d/mysql.sh .創(chuàng)建用戶和授權(quán): #useradd mysql #passwd mysql #mkdir -p /data/mysql #chown -R mysql:mysql /data/mysql #chmod -R 755 /data/mysql .設(shè)置參數(shù): [mysqld] #basic #skip-grant-tables #validate_password =OFF datadir = /data/mysql port = 3306 pid-file = /tmp/mysql.pid socket = /tmp/mysql.sock log_error = error.log slow-query-log = 1 slow-query-log-file = slow.log long_query_time = 0.2 log-bin = mysql_bin.log binlog_format = ROW expire-logs-days = 1 relay-log = mysql_relay.log relay_log_recovery = 1 general_log = on general_log_file = general.log lower_case_table_names = 1 server-id = 1 character_set_client_handshake = FALSE character_set_server = utf8mb4 collation_server = utf8mb4_unicode_ci init_connect ='SET NAMES utf8mb4' interactive_timeout = 172800 wait_timeout = 172800 max_prepared_stmt_count =1048576 max_connections = 8000 #connections max_connections=4000 key_buffer_size=200M low_priority_updates=1 table_open_cache = 8000 back_log=1500 query_cache_type=0 table_open_cache_instances=16 #files innodb_file_per_table =on innodb_log_file_size=1024M innodb_log_files_in_group = 3 innodb_open_files=4000 #buffers innodb_buffer_pool_size=1G innodb_buffer_pool_instances=32 #innodb_additional_mem_pool_size=20M innodb_log_buffer_size=64M join_buffer_size=32K sort_buffer_size=32K #innodb innodb_checksums=0 innodb_doublewrite=0 innodb_support_xa=0 innodb_thread_concurrency=0 innodb_flush_log_at_trx_commit=2 innodb_max_dirty_pages_pct=50 innodb_use_native_aio=1 innodb_stats_persistent = 1 #innodb_spin_wait_delay= 6 / 96 #performance innodb_adaptive_flushing = 1 innodb_flush_neighbors = 0 innodb_read_io_threads = 4 innodb_write_io_threads = 4 innodb_io_capacity = 4000 innodb_purge_threads=1 innodb_adaptive_hash_index=0 #monitor innodb_monitor_enable = '%' performance_schema=OFF [mysql] user = root .初始化數(shù)據(jù)庫(kù)實(shí)例: /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --initialize-insecure .啟動(dòng): # cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql # /etc/init.d/mysql start Starting MySQL... SUCCESS! .驗(yàn)證和設(shè)置遠(yuǎn)程訪問(wèn): [root@node1 soft]# mysql -p -S /tmp/mysql.sock mysql> grant all privileges on *.* to root@'%' identified by 'oracle' with grant option; Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
補(bǔ)充:mysql 5.7.22 免安裝版Windows配置
下載mysql 5.7.22
解壓文件,發(fā)現(xiàn)根目錄下沒(méi)有data目錄
進(jìn)入bin 目錄:
cd d:\Program Files\MySQL\MySQL Server 5.7\bin
運(yùn)行
mysqld --initialize-insecure --user=mysql
執(zhí)行完命令發(fā)現(xiàn)根目錄多了個(gè)data 的文件夾
配置my.ini 文件,
執(zhí)行命令:
mysqld install MYSQL57 --defaults-file="G:\DataDBs\mysql-5.7\my.ini"
啟動(dòng)mysql 服務(wù),默認(rèn)密碼為空登錄進(jìn)去
update mysql.user set authentication_string=password('newpwd'),password_expired='N' where user='root';
修改密碼并修改過(guò)時(shí)策略(字段名和mysql 5.6略有不同,5.6的:update user set password = password('newpwd'),password_expired='N' where user = 'root';)
-- 開(kāi)啟遠(yuǎn)程連接權(quán)限 grant all on *.* to root@'%' identified by 'newpwd' with grant option; flush privileges;
然后重啟mysql 服務(wù)就配置完成了
總結(jié)
以上所述是小編給大家介紹的MySQL 5.7.22 二進(jìn)制包安裝及免安裝版Windows配置方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
關(guān)于Mysql中current_time/current_date()與now()區(qū)別
這篇文章主要介紹了關(guān)于current_time/current_date()與now()區(qū)別,在Mysql中 current_time函數(shù)是顯示當(dāng)前時(shí)間的,而其他兩個(gè)函數(shù)有何不同呢, 接下來(lái)我們就一起來(lái)看看吧2023-04-04Mysql數(shù)據(jù)庫(kù)支持的存儲(chǔ)引擎對(duì)比
這篇文章主要介紹了Mysql數(shù)據(jù)庫(kù)支持的各個(gè)存儲(chǔ)引擎之間的對(duì)比分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2021-09-09insert和select結(jié)合實(shí)現(xiàn)"插入某字段在數(shù)據(jù)庫(kù)中的最大值+1"的方法
今天小編就為大家分享一篇關(guān)于insert和select結(jié)合實(shí)現(xiàn)"插入某字段在數(shù)據(jù)庫(kù)中的最大值+1"的方法,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧2019-03-03mysql 8.0.17 winx64(附加navicat)手動(dòng)配置版安裝教程圖解
這篇文章主要介紹了mysql 8.0.17 winx64(附加navicat)手動(dòng)配置版安裝教程圖解,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-08-08在MySQL中使用通配符時(shí)應(yīng)該注意的問(wèn)題
這篇文章主要介紹了在MySQL中使用通配符時(shí)應(yīng)該注意的問(wèn)題,主要是下劃線的使用容易引起的錯(cuò)誤,需要的朋友可以參考下2015-05-05深入Mysql,SqlServer,Oracle主鍵自動(dòng)增長(zhǎng)的設(shè)置詳解
本篇文章是對(duì)Mysql,SqlServer,Oracle主鍵自動(dòng)增長(zhǎng)的設(shè)置進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06淺析MySQL內(nèi)存的使用說(shuō)明(全局緩存+線程緩存)
本篇文章是對(duì)MySQL內(nèi)存的使用說(shuō)明(全局緩存+線程緩存)進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06