濮阳杆衣贸易有限公司

主頁 > 知識庫 > Ubuntu 18.04 安裝mysql5.7

Ubuntu 18.04 安裝mysql5.7

熱門標簽:電銷機器人各個細節(jié)介紹 電話機器人市場趨勢 南昌高頻外呼系統(tǒng)哪家公司做的好 淄博400電話申請 昆明電信400電話辦理 俄國地圖標注app 溫州瑞安400電話怎么申請 百度地圖標注后不顯示 電銷機器人 行業(yè)

Ubuntu18.04安裝mysql5.7,供大家參考,具體內(nèi)容如下

1.1安裝

首先執(zhí)行下面三條命令:

# 安裝mysql服務(wù)
sudo apt-get install mysql-server
# 安裝客戶端
sudo apt install mysql-client
# 安裝依賴
sudo apt install libmysqlclient-dev
# 檢查狀態(tài)
sudo netstat -tap | grep mysql

1.2設(shè)置root密碼

mysql5.7安裝完成后普通用戶不能進mysql,原因:root的plugin被修改成了auth_socket,用密碼登陸的plugin應(yīng)該是mysql_native_password,直接用root權(quán)限登錄就不用密碼,修改root密碼和登錄驗證方式:

$ sudo su
# mysql
mysql>
mysql> select user, plugin from mysql.user;
+------------------+-----------------------+
| user | plugin |
+------------------+-----------------------+
| root | auth_socket |
| mysql.session | mysql_native_password |
| mysql.sys | mysql_native_password |
| debian-sys-maint | mysql_native_password |
+------------------+-----------------------+
4 rows in set (0.00 sec)
mysql> update mysql.user set authentication_string=PASSWORD('123456'), plugin='mysql_native_password' where user='root';
mysql> flush privileges;
mysql> exit
Bye
# exit
$ sudo /etc/init.d/mysql restart
$ mysql -uroot -p

Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.22-0ubuntu18.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

1.3配置mysql遠程登錄

# 修改配置文件,注釋掉bind-address = 127.0.0.1
$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

# 保存退出,然后進入mysql服務(wù),執(zhí)行授權(quán)命令:
$ mysql -uroot -p

mysql> grant all on *.* to root@'%' identified by '123456' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
$ sudo /etc/init.d/mysql restart

精彩專題分享:

mysql不同版本安裝教程

mysql5.7各版本安裝教程

mysql5.6各版本安裝教程

mysql8.0各版本安裝教程

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

您可能感興趣的文章:
  • Ubuntu18.04下安裝MySQL(圖文教程)
  • linux系統(tǒng)ubuntu18.04安裝mysql 5.7
  • Ubuntu18.04 安裝mysql8.0.11的圖文教程
  • Ubuntu18.04(linux)安裝MySQL的方法步驟
  • Ubuntu 18.04下mysql 8.0 安裝配置方法圖文教程
  • Ubuntu下MySQL root密碼忘記的解決方法
  • 在ubuntu中重置mysql服務(wù)器root密碼的方法
  • Ubuntu 18.04 安裝MySQL時未提示輸入密碼的問題及解決方法

標簽:甘南 葫蘆島 拉薩 嘉峪關(guān) 洛陽 安徽 吐魯番

巨人網(wǎng)絡(luò)通訊聲明:本文標題《Ubuntu 18.04 安裝mysql5.7》,本文關(guān)鍵詞  Ubuntu,18.04,安裝,mysql5.7,Ubuntu,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Ubuntu 18.04 安裝mysql5.7》相關(guān)的同類信息!
  • 本頁收集關(guān)于Ubuntu 18.04 安裝mysql5.7的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    鱼台县| 竹溪县| 延津县| 黔西县| 西宁市| 张家口市| 阿图什市| 安康市| 贵港市| 仙居县| 康马县| 庆云县| 盈江县| 泰安市| 绵竹市| 新郑市| 庄河市| 全州县| 北辰区| 依兰县| 辽宁省| 湛江市| 武隆县| 望谟县| 武穴市| 焦作市| 招远市| 年辖:市辖区| 西安市| 防城港市| 东山县| 新乐市| 乐陵市| 鄂托克前旗| 兴城市| 若尔盖县| 桃江县| 旬邑县| 吉木萨尔县| 桓台县| 南漳县|