在64位windows7操作系統(tǒng)上安裝和配置mysql數(shù)據(jù)庫系統(tǒng)。
一、mysql5.7.11 winx64安裝配置方法
步驟:
1、官網(wǎng)下載MySQL數(shù)據(jù)庫和驅(qū)動程序(Windows):mysql-5.7.11-winx64.zip
2、創(chuàng)建數(shù)據(jù)庫配置文件:my.ini
Example:
1.解壓壓縮包至:D:Program Files
2.創(chuàng)建 D:Program Filesmysql-5.7.11-winx64my.ini 配置文件
3、初始化和啟動Mysql服務(wù):
1.以管理員權(quán)限運行cmd
2.進入mysql的bin下
3.初始化,生成data文件夾
>mysqld –initialize-insecure (不設(shè)置root密碼,建議使用)
>mysqld –initialize (生成一個隨機的root密碼)
3.安裝MySql服務(wù)
>mysqld -install
4.啟動mysql
>net start mysql
4、登陸mysql
>mysql -u root -p
第一次登錄時無需密碼直接回車登錄
登錄mysql之后,設(shè)置root密碼
>set password for root@localhost = password(‘YourPassword’);
或者使用mysqlamdin修改root密碼
>mysqladmin -u root -p password NewPassword
二、簡單的數(shù)據(jù)庫操作和測試
1、以管理員權(quán)限運行cmd,進入程序所在目錄,啟動Mysql服務(wù)
2、數(shù)據(jù)庫操作
show databases; //所有數(shù)據(jù)庫列表 create database dbName; //創(chuàng)建數(shù)據(jù)庫 use dbName; //選擇數(shù)據(jù)庫 show tables; //顯示數(shù)據(jù)表列表
3、查看數(shù)據(jù)表中的條目
desc tableName; describe tableName; show columns from tableName; show create table tableName;
4、清空數(shù)據(jù)表中所有條目:
truncate table 表名;? //清空全部數(shù)據(jù),不寫日志,不可恢復(fù),速度極快
delete from 表名;??? //清空全部數(shù)據(jù),寫日志,數(shù)據(jù)可恢復(fù),速度慢
以上就是mysql 5.7.11winx64安裝配置方法,希望對大家的學(xué)習(xí)有所幫助。