匯入mysql資料庫

來源:互聯網
上載者:User

標籤:

  • Mysql5.7.11安裝 - yum方式:

 

1、mysql官方網站下載mysql yum repo檔案(rpm檔案),安裝後在系統/etc/yum.repo.d目錄多出2個檔案

2、yum search mysql

3、yum install mysql-community-server.x86_64 (mysql社區版)

 

 

  • 新安裝mysql後無root密碼無法登陸問題:

 

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資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.