日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

安裝MySQL

sudo apt-get update
sudo apt-get install mysql-server

輸出:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  mysql-server
0 upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
Need to get 9,948 B of archives.
After this operation, 111 kB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/ubuntu bionic-updates/main amd64 mysql-server all 5.7.34-0ubuntu0.18.04.1 [9,948 B]
Fetched 9,948 B in 0s (139 kB/s)
Selecting previously unselected package mysql-server.
(Reading database ... 110437 files and directories currently installed.)
Preparing to unpack .../mysql-server_5.7.34-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.34-0ubuntu0.18.04.1) ...
Setting up mysql-server (5.7.34-0ubuntu0.18.04.1) ...

初始化配置

sudo mysql_secure_installation

其它都可以回車,需要輸入password的時候輸入兩次,這個是root密碼。

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
# 檢測密碼插件,可以增加安全性,一般學習時不需要。
VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No:

# 請在此設置root密碼
Please set the password for root here.
New password:
Re-enter new password:


By default, a MySQL installation has an anonymous user,allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

# 是否移除匿名用戶?
Remove anonymous users? (Press y|Y for Yes, any other key for No) :
 ... skipping.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
# 不允許root遠程登錄?
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :
 ... skipping.
 
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

# 移除test數據庫并訪問?
Remove test database and access to it? (Press y|Y for Yes, any other key for No) :
 ... skipping.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!

檢查mysql服務狀態

systemctl status mysql.service
# 或者
sudo service mysql status

正常顯示:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-07-05 03:31:45 UTC; 2min 37s ago
 Main PID: 47667 (mysqld)
    Tasks: 28 (limit: 4629)
   CGroup: /system.slice/mysql.service
           └─47667 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Jul 05 03:31:44 begin_server systemd[1]: Starting MySQL Community Server...
Jul 05 03:31:45 begin_server systemd[1]: Started MySQL Community Server.

修改mysql配置

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

注釋掉bind_address = 127.0.0.1。

ubuntu18.04中Mysql5.7數據庫安裝及遠程登錄

 

登錄mysql

得用sudo, 輸入你剛才設定的密碼。

sudo mysql -r root -p

進入后創建數據庫并添加用戶及極限,study@"%"表示用戶名為study, 且可以從任何地方訪問,123是密碼。

##1 創建數據庫beginner
create database beginner;
##2 創建用戶study(密碼123) 并賦予其beginner數據庫的所有權限
GRANT ALL PRIVILEGES ON beginner.* TO study@"%"IDENTIFIED BY "123";
##3 刷新權限
flush privileges;

通過navicat遠程連接數據庫

端口默認就是3306, IP地址是我內部局域網的虛擬機192.168.1.8。

ubuntu18.04中Mysql5.7數據庫安裝及遠程登錄

 

連接信息:

ubuntu18.04中Mysql5.7數據庫安裝及遠程登錄

 

通過SQLYog遠程登錄

ubuntu18.04中Mysql5.7數據庫安裝及遠程登錄

 

分享到:
標簽:Mysql5
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定