deepin v20安裝mysql

2020-10-13 11:01:03

deepin v20 換源和安裝mysql

由於deepin v20不能直接安裝mysql所以先進行換源,更換成阿里源,這樣以後速度可以更快

  1. 修改檔案 sudo vim /etc/apt/sources.list
#刪除內容,並新增以下內容:
## Generated by deepin-installer
deb [by-hash=force] https://mirrors.aliyun.com/deepin/ panda main contrib non-free

2.執行sudo apt-get update
3.執行sudo apt-get upgrade命令。

安裝mysql

1.執行安裝mysql的語句

sudo apt-get install mysql-server mysql-client

2.檢視可登陸賬戶並檢視密碼
在這裡插入圖片描述3.獲取到了登陸mysql的賬戶密碼

lin@lin-PC:~$ mysql -udebian-sys-maint -pjSaNFiRzjlDAxiRN
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21-1 (Debian)

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> 

4.之後依次進入mysql資料庫,修改root密碼,重新整理快取。之後就可以exit退出使用root賬戶登入了:

use mysql;
update user set plugin="mysql_native_password",authentication_string=password('新密碼') where user="root";
FLUSH PRIVILEGES;

5.使用修改後的帳號密碼登陸

mysql -uroot -p000000