《MYSQL教程Linux下安裝MySQL5.7.19問題小結(jié)》要點(diǎn):
本文介紹了MYSQL教程Linux下安裝MySQL5.7.19問題小結(jié),希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
MYSQL數(shù)據(jù)庫第一次在自己虛機(jī)上安裝mysql 中間碰到很多問題 在這里記下來,分享一下.
MYSQL數(shù)據(jù)庫
linux centOS 6
MYSQL數(shù)據(jù)庫mysql版本 mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
MYSQL數(shù)據(jù)庫1、groupadd mysql
????? ## 添加一個(gè)mysql組
MYSQL數(shù)據(jù)庫2、useradd -r -g mysql mysql
??? ## 添加一個(gè)用戶
MYSQL數(shù)據(jù)庫3、解壓縮下載的包,tar -xzvf /usr/local/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz
MYSQL數(shù)據(jù)庫4、mv /usr/local/mysql-5.7.13-linux-glibc2.5-x86_64 /usr/local/mysql?
##重命名
MYSQL數(shù)據(jù)庫解壓后目錄:
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫5、mkdir? /usr/local/mysql/data
## 默認(rèn)是沒有這個(gè)文件夾得 用來放數(shù)據(jù)
MYSQL數(shù)據(jù)庫6、chown -R mysql:mysql ./?
? ##進(jìn)入mysql包中, 給這個(gè)包授權(quán) 給mysql
MYSQL數(shù)據(jù)庫7、chgrp -R mysql:mysql ./?
? ##進(jìn)入mysql包中
MYSQL數(shù)據(jù)庫8、bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data????
##進(jìn)入mysql文件名? basedir 為mysql 的路徑, datadir 為mysql的 data 包,里面?????? 存放著mysql自己的包, 如user
MYSQL數(shù)據(jù)庫網(wǎng)上很多教程mysql_install_db
方式安裝的,我剛開始也是這么安裝,各種報(bào)錯(cuò)、失敗,mysql_install_db 命令不推薦、按上面的命令來就好
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫此處需要注意記錄生成的臨時(shí)密碼,如上文:YLi>7ecpe;YP
MYSQL數(shù)據(jù)庫9、bin/mysql_ssl_rsa_setup? --datadir=/usr/local/mysql/data
MYSQL數(shù)據(jù)庫10、進(jìn)入mysql??? support-file
MYSQL數(shù)據(jù)庫11、cp my-default.cnf /etc/my.cnf
MYSQL數(shù)據(jù)庫發(fā)現(xiàn)這個(gè)版本就沒有my-default
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫這個(gè)是時(shí)候我們自己創(chuàng)建一個(gè)(內(nèi)部代碼如圖): 重點(diǎn)下面兩個(gè)socket(紅色)對(duì)應(yīng)的值必須一致,不然啟動(dòng)以后鏈接不上
MYSQL數(shù)據(jù)庫
#dvice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES # 一般配置選項(xiàng) basedir = /usr/local/mysql datadir = /usr/local/mysql/data port = 3306 #socket = /temp/mysqld.sock socket = /var/run/mysqld/mysqld.sock character-set-server=utf8 #下面是可選項(xiàng),要不要都行,如果出現(xiàn)啟動(dòng)錯(cuò)誤,則全部注釋掉,保留最基本的配置選項(xiàng),然后嘗試添加某些配置項(xiàng)后啟動(dòng),檢測(cè)配置項(xiàng)是否有誤 back_log = 300 max_connections = 3000 max_connect_errors = 50 table_open_cache = 4096 max_allowed_packet = 32M #binlog_cache_size = 4M max_heap_table_size = 128M read_rnd_buffer_size = 16M sort_buffer_size = 16M join_buffer_size = 16M thread_cache_size = 16 query_cache_size = 128M query_cache_limit = 4M ft_min_word_len = 8 thread_stack = 512K transaction_isolation = REPEATABLE-READ tmp_table_size = 128M #log-bin=mysql-bin long_query_time = 6 server_id=1 innodb_buffer_pool_size = 1G innodb_thread_concurrency = 16 innodb_log_buffer_size = 16M innodb_log_file_size = 512M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 innodb_file_per_table = on [mysqldump] quick max_allowed_packet = 32M [mysql] no-auto-rehash socket = /var/run/mysqld/mysqld.sock default-character-set=utf8 safe-updates [myisamchk] key_buffer = 16M sort_buffer_size = 16M read_buffer = 8M write_buffer = 8M [mysqlhotcopy] interactive-timeout [mysqld_safe] open-files-limit = 8192 [client] loose-default-character-set = utf8
MYSQL數(shù)據(jù)庫12、cp mysql.server /etc/init.d/mysql
MYSQL數(shù)據(jù)庫13、vim /etc/init.d/mysql
???????????? ##修改basedir=? 自己的路徑???? 修改datadir= 自己的路徑
MYSQL數(shù)據(jù)庫14、bin/mysqld_safe --user=mysql
&???? ## 啟動(dòng)mysql
MYSQL數(shù)據(jù)庫13、./mysql -uroot -p
##bin目錄下
MYSQL數(shù)據(jù)庫14、 輸入臨時(shí)密碼
MYSQL數(shù)據(jù)庫15、修改MySQL的root密碼
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫此時(shí)mysql只有本地localhost可以訪問
MYSQL數(shù)據(jù)庫16 修改可遠(yuǎn)程訪問
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫重啟MySQL服務(wù)
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫此時(shí)本地可以正常使用MySQL
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫測(cè)試遠(yuǎn)程連接
MYSQL數(shù)據(jù)庫
MYSQL數(shù)據(jù)庫總結(jié)
MYSQL數(shù)據(jù)庫以上所述是小編給大家介紹的Linux下安裝MySQL5.7.19問題小結(jié),希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的.在此也非常感謝大家對(duì)維易PHP網(wǎng)站的支持!
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/3402.html