標籤:
1、mysql官方網站下載mysql yum repo檔案(rpm檔案),安裝後在系統/etc/yum.repo.d目錄多出2個檔案
2、yum search mysql
3、yum install mysql-community-server.x86_64 (mysql社區版)
1.systemctl stop mysqld.service 關閉mysql服務
2.vi /etc/my.cnf 在mysqld下面添加 skip-grant-tables,重啟mysql服務systemctl start mysqld.service
3.登入mysql,mysql -u root 不用密碼直接斷行符號
4.輸入 update user set authentication_string=password(‘密碼‘) where User=‘root‘ and Host=‘localhost‘;
5.成功後輸入 flush privileges;
6.exit退出mysql
7.vi /etc/my.cnf 把 skip-grant-tables 一句刪除儲存退出重啟mysql服務
8.重新登入mysql,mysql -u root -p斷行符號 輸入你剛才填寫的密碼
9.登入成功後你的操作可能會出現如下兩句
Your password does not satisfy the current policy requirements
You must reset your password using ALTER USER statement before executing this statement.
進入mysql執行命令: alter user ‘root‘@‘localhost‘ identified by ‘password‘
=====================
Show databases;
Create dbname;
Use dbname;
Set names utf8;
Mysql -u root -p dbname<script.sql;
匯入mysql資料庫