Mysql安裝配置,修改初試密碼。


綠色版本,解壓縮

D:\Software\mysql-advanced-5.6.18-winx64

 

my-default.ini 改名my.ini

my.ini內容如下

# 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.
[client]
default-character-set=utf8

[mysqld]
character_set_server=utf8
# 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 = D:\Software\mysql-advanced-5.6.18-winx64
datadir = D:\Software\mysql-advanced-5.6.18-winx64\data
# port = .....
# server_id = .....


# 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 

打開 Windows 環境變量設置, 新建變量名 MYSQL_HOME , 變量值為 MySQL 安裝目錄路徑, 這里為 D:\Software\mysql-advanced-5.6.18-winx64

在 環境變量 的 Path 變量中添加 ;%MYSQL_HOME%\bin;

安裝 MySQL 服務, 打開Windows命令提示符, 執行命令: mysqld --install MySQL --defaults-file="D:\Software\mysql-advanced-5.6.18-winx64\my.ini"

啟動: net start MySQL

停止: net stop MySQL

卸載: sc delete MySQL

 

修改密碼:

mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.32-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>use mysql

mysql> UPDATE user SET password=PASSWORD(’新密碼’) WHERE User=’root’;

mysql> FLUSH PRIVILEGES;

mysql>quit;

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM