記錄mysql5.7.14安裝與配置過程,梳理成文,希望對大家有所幫助。
1.配置文檔:
| ####################配置文件開始################### # For advice 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. [client] default-character-set=utf8 [mysqld] port=3306 basedir ="D:/mysql-5.7.14-winx64" datadir ="D:/mysql-5.7.14-winx64/data/" tmpdir ="D:/mysql-5.7.14-winx64/data/" socket ="D:/mysql-5.7.14-winx64/data/mysql.sock" log-error="D:/mysql-5.7.14-winx64/data/mysql_error.log" #server_id = 2 #skip-locking max_connections=100 table_open_cache=256 query_cache_size=1M tmp_table_size=32M thread_cache_size=8 innodb_data_home_dir="D:/mysql-5.7.14-winx64/data/" innodb_flush_log_at_trx_commit =1 innodb_log_buffer_size=128M innodb_buffer_pool_size=128M innodb_log_file_size=10M innodb_thread_concurrency=16 innodb-autoextend-increment=1000 join_buffer_size = 128M sort_buffer_size = 32M read_rnd_buffer_size = 32M max_allowed_packet = 32M explicit_defaults_for_timestamp=true sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" skip-grant-tables #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES####################配置文件結束################### | 
2. 添加環境變量
3.啟動服務
net start mysql
MySQL 服務正在啟動 .
MySQL 服務無法啟動。 
問題解決:刪除data文件夾里的內容
 然后輸入如下命令:

4.登錄Access denied for user 'root'@'localhost' (using password: NO)問題解決
1).在mysql所在的根目錄下找到my-default.ini,復制里面的全部內容,
新建一個txt文檔,把內容復制進去,然后保存名字改為my.ini,注意需要把文件類型也改為ini,方法查看文件類型,然后把txt后綴改為ini,如果不懂可以上網查找。
2).my.ini配置文件,打開配置文件,找到[mysqld]一行,在下面添加skip-grant-tables后保存該文件,重新啟mysql動服務。
----1.通過cmd進如到Mysql下的bin目錄下,輸入mysql -u root -p就可以不用密碼登錄了,出現password:的時候直接回車可以進入,不會出現ERROR 1045 (28000),但很多操作都會受限制,因為我們不能grant(沒有權限)。
----2.進入mysql數據庫:mysql> use mysql;Database changed
----3.輸入update mysql.user set authentication_string=password('root') where user='root' ;
 輸入update mysql.user set authentication_string=password('root') where user='root' ;其中password('‘)中為你今后的密碼。             
新聞熱點
疑難解答