日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql.zip免安装版配置

發布時間:2023/11/30 数据库 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql.zip免安装版配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

MYSQL?ZIP免安裝版配置

1. 下載MySQL 選擇自己想要的.本次安裝.我使用的是mysql-5.6.17-winx64?

?地址:http://dev.mysql.com/downloads/mysql/

?

2. 解壓zip 文件. 在mysql 的根目錄下找到 ?my-default.ini ?復制出一個 my.ini 文件, 根據你需要的位置修改 my.ini 文件

?

a)在[mysqld]下追加
-------
basedir = "d:\\mysql"
datadir = "d:\\mysql\\data"
character-set-server = utf8
-------
b) 在[client]下追加
-------
default-character-set = utf8

# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.6/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]# Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin# These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = .....basedir =D:\work\mysql-5.6.17-winx64 datadir =F:\db-data\mysql character-set-server = utf8# Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [client] default-character-set = utf8

?

3. 啟動服務

保存

my.ini

的配置,然后打開命令行切換到mysql解壓目錄下的bin 目錄;

執行?mysqld.exe console 命令測試一下

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe console 2014-04-22 19:11:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca ted. Please use --explicit_defaults_for_timestamp server option (see documentati on for more details).

然后執行?mysqld.exe console 命令啟動mysql?

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --console 2014-04-22 19:11:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca ted. Please use --explicit_defaults_for_timestamp server option (see documentati on for more details). 2014-04-22 19:11:33 5624 [Note] Plugin 'FEDERATED' is disabled. mysqld.exe: Table 'mysql.plugin' doesn't exist 2014-04-22 19:11:33 5624 [ERROR] Can't open the mysql.plugin table. Please run m ysql_upgrade to create it. 2014-04-22 19:11:33 5624 [Note] InnoDB: Using atomics to ref count buffer pool p ages 2014-04-22 19:11:33 5624 [Note] InnoDB: The InnoDB memory heap is disabled 2014-04-22 19:11:33 5624 [Note] InnoDB: Mutexes and rw_locks use Windows interlo cked functions 2014-04-22 19:11:33 5624 [Note] InnoDB: Compressed tables use zlib 1.2.3 2014-04-22 19:11:33 5624 [Note] InnoDB: Not using CPU crc32 instructions 2014-04-22 19:11:33 5624 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2014-04-22 19:11:33 5624 [Note] InnoDB: Completed initialization of buffer pool 2014-04-22 19:11:33 5624 [Note] InnoDB: Highest supported file format is Barracu da. 2014-04-22 19:11:33 5624 [Note] InnoDB: 128 rollback segment(s) are active. 2014-04-22 19:11:33 5624 [Note] InnoDB: Waiting for purge to start 2014-04-22 19:11:33 5624 [Note] InnoDB: 5.6.17 started; log sequence number 1600 607 2014-04-22 19:11:33 5624 [Warning] No existing UUID has been found, so we assumethat this is the first time that this server has been started. Generating a newUUID: dcd35109-ca0e-11e3-a872-003018a05bef. 2014-04-22 19:11:33 5624 [Note] Server hostname (bind-address): '*'; port: 3306 2014-04-22 19:11:33 5624 [Note] IPv6 is available. 2014-04-22 19:11:33 5624 [Note] - '::' resolves to '::'; 2014-04-22 19:11:33 5624 [Note] Server socket created on IP: '::'. 2014-04-22 19:11:33 5624 [ERROR] Fatal error: Can't open and lock privilege tabl es: Table 'mysql.user' doesn't exist

注:這里出現異常 :Table 'mysql.user' doesn't exist 是因為我沒有吧數據文件復制到 my.ini 里面配置的路徑下,

數據文件是在 mysql 解壓目錄的下 的 data 目錄, 吧整個目錄里的內容復制到配置文件里寫的目錄里,然后啟動

?

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --console 2014-04-22 19:16:31 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca ted. Please use --explicit_defaults_for_timestamp server option (see documentati on for more details). 2014-04-22 19:16:31 6180 [Note] Plugin 'FEDERATED' is disabled. 2014-04-22 19:16:31 6180 [Note] InnoDB: Using atomics to ref count buffer pool p ages 2014-04-22 19:16:31 6180 [Note] InnoDB: The InnoDB memory heap is disabled 2014-04-22 19:16:31 6180 [Note] InnoDB: Mutexes and rw_locks use Windows interlo cked functions 2014-04-22 19:16:31 6180 [Note] InnoDB: Compressed tables use zlib 1.2.3 2014-04-22 19:16:31 6180 [Note] InnoDB: Not using CPU crc32 instructions 2014-04-22 19:16:31 6180 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2014-04-22 19:16:31 6180 [Note] InnoDB: Completed initialization of buffer pool 2014-04-22 19:16:32 6180 [Note] InnoDB: Highest supported file format is Barracu da. 2014-04-22 19:16:32 6180 [Note] InnoDB: 128 rollback segment(s) are active. 2014-04-22 19:16:32 6180 [Note] InnoDB: Waiting for purge to start 2014-04-22 19:16:32 6180 [Note] InnoDB: 5.6.17 started; log sequence number 1625 987 2014-04-22 19:16:32 6180 [Warning] No existing UUID has been found, so we assumethat this is the first time that this server has been started. Generating a newUUID: 8f19129f-ca0f-11e3-a876-003018a05bef. 2014-04-22 19:16:32 6180 [Note] Server hostname (bind-address): '*'; port: 3306 2014-04-22 19:16:32 6180 [Note] IPv6 is available. 2014-04-22 19:16:32 6180 [Note] - '::' resolves to '::'; 2014-04-22 19:16:32 6180 [Note] Server socket created on IP: '::'. 2014-04-22 19:16:32 6180 [Note] Event Scheduler: Loaded 0 events 2014-04-22 19:16:32 6180 [Note] mysqld.exe: ready for connections. Version: '5.6.17' socket: '' port: 3306 MySQL Community Server (GPL)

證明mysql服務已啟動

?

6. 設置登陸mysql root帳號的的密碼


在mysql/bin 目錄下打開新的命令行,輸入mysql 回車

?

D:\work\mysql-5.6.17-winx64\bin>mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.17 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

看到上面類似內容說明登陸成功,此時的root帳號是沒有密碼的,而我也沒打算要密碼

想要設置可使用命令

直接運行命令行窗口輸入下面的

?mysqladmin?-u?root?password?

你的密碼

?

?

這樣就Ok了,

?

7. 安裝mysql服務

在bin目錄下執行命令

mysqld.exe --install MySQL5.6.17 --defaults-file="D:\work\mysql-5.6.17-winx64\my.ini"

結果如下.

D:\work\mysql-5.6.17-winx64\bin>mysqld.exe --install MySQL5.6.17 --defaults-file ="D:\work\mysql-5.6.17-winx64\my.ini" Service successfully installed.

8.啟動服務

net start MySQL5.6.17 D:\work\mysql-5.6.17-winx64\bin>net start MySQL5.6.17 MySQL5.6.17 服務正在啟動 . MySQL5.6.17 服務已經啟動成功。

注:若啟動不成功修改注冊表開始->運行->regedit
找HKEY_LOCAL_MECHINE---SYSTEM ---ControlSet001或ControlSet002中找Services,
再找MySQL項,修改 ImagePath值改為:"D:\work\mysql-5.6.17-winx64\bin\mysqld" --defaults-file="D:\work\mysql-5.6.17-winx64\my.ini" MySQL

?

最后為了方便添加環境變量.

MYSQL=D:\work\mysql-5.6.17-winx64

Path=%MYSQL%/bin;Path...

測試:

C:\Windows\System32>SET PATH=%MYSQL%\bin;%PATH%C:\Windows\System32>echo PATH PATHC:\Windows\System32>echo %PATH% D:\work\mysql-5.6.17-winx64\bin;D:\Program Files\java\jdk1.7.0_15\bin;D:\ProgramFiles\java\jdk1.7.0_15\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\System 32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\C:\Windows\System32>mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.17 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

?

到此結束.

?

?

轉載于:https://www.cnblogs.com/mjorcen/p/3681328.html

總結

以上是生活随笔為你收集整理的mysql.zip免安装版配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。