mysql安裝 連線

2022-10-05 08:39:08 字數 1473 閱讀 3973

開啟後進入mysql的bin目錄,執行:

mysqld --initialize --console

生成密碼:

2022-03-04t08:45:54.013764z 6 [note] [my-010454] [server] a temporary password is generated for root@localhost: lybkoof-f96;

mysqld --install

出現install/remove of the service denied!錯誤,就用管理員開啟cmd

出現了:ps e:\mysql8\bin> .\mysqld --install

the service already exists!

the current server installed: f:\mysql5.7\bin\mysqld mysql

用這個命令sc刪除的mysql

my.ini

[mysqld]

# 設定3306埠

port=3306

# 設定mysql的安裝目錄

basedir=e:\mysql8\mysql

# 設定mysql資料庫的資料的存放目錄

datadir=e:\mysql8\data

# 允許最大連線數

max_connections=200

# 允許連線失敗的次數。

max_connect_errors=10

# 服務端使用的字符集預設為utf8mb4

character-set-server=utf8mb4

# 建立新錶時將使用的預設儲存引擎

default-storage-engine=innodb

# 預設使用「mysql_native_password」外掛程式認證

#mysql_native_password

default_authentication_plugin=mysql_native_password

[mysql]

# 設定mysql客戶端預設字符集

default-character-set=utf8mb4

[client]

# 設定mysql客戶端連線服務端時預設使用的埠

port=3306

default-character-set=utf8mb4

1初始化mysql 連線mysql + 修改密碼

進行資料庫連線 mysql -u root -p

有了mysql> 這個的時候 你就可以去改密碼了!

alter user 'root'@'localhost' identified by '新密碼';

alter user 'root'@'localhost' identified by '123456';

query ok, 0 rows affected (0.19 sec)

2建立服務

3啟動服務

mysql安裝連線錯誤 MySQL連線出錯及解決

1.安裝完系統自帶的mysql後連線資料庫 mysql u root error2002 can t connect to local mysql server through socket var lib mysql mysql.sock 2 連線時出現如上錯誤提示導致連線資料庫失敗!2.此時檢視...

MYSQL安裝連線問題

mysql總是會碰到各種各樣千奇百怪的問題。這裡專門做個記錄。進入mysql指令視窗 檢視所有引擎 show engines 檢視當前預設引擎 show variables like storage engine 檢視mysql伺服器版本 select version 修改配置檔案my.ini的in...

MySQL 安裝和連線

資料庫指的是以一定方式儲存在一起 能為多個使用者共享 具有盡可能小的冗餘度 與應用程式彼此獨立的資料集合。三種型別的資料庫 關係型資料庫 mysql microsoft access sql server oracle 非關係型資料庫 mongodb bigtable google membase....