湖濱散記部落格的樹心幽徑[login][主頁]
448:20181217在ubuntu 1604裝mysql server

(1) $ sudo apt-get install mysql-server
:

以下套件為自動安裝,並且已經無用:
  linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic
  linux-image-4.10.0-28-generic linux-image-extra-4.10.0-28-generic
Use 'sudo apt autoremove' to remove them.
下列的額外套件將被安裝:
  libaio1 libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7
  mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7
建議套件:
  libipc-sharedcache-perl mailx tinyca
下列【新】套件將會被安裝:
  libaio1 libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7
  mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
升級 0 個,新安裝 8 個,移除 0 個,有 254 個未被升級。
需要下載 18.4 MB 的套件檔。
此操作完成之後,會多佔用 161 MB 的磁碟空間。
是否繼續進行 [Y/n]? [Y/n] y
下載:1 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 libaio1 amd64 0.3.110-2 [6,356 B]
下載:2 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-core-5.7 amd64 5.7.24-0ubuntu0.16.04.1 [6,030 kB]
下載:3 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-5.7 amd64 5.7.24-0ubuntu0.16.04.1 [1,720 kB]
下載:4 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-core-5.7 amd64 5.7.24-0ubuntu0.16.04.1 [7,757 kB]
下載:5 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libevent-core-2.0-5 amd64 2.0.21-stable-2ubuntu0.16.04.1 [70.6 kB]
下載:6 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-5.7 amd64 5.7.24-0ubuntu0.16.04.1 [2,726 kB]
下載:7 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 libhtml-template-perl all 2.95-2 [60.4 kB]
下載:8 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server all 5.7.24-0ubuntu0.16.04.1 [10.8 kB]
取得 18.4 MB 用了 4秒 (4,018 kB/s)     
正在預先設定套件 ...
選取了原先未選的套件 libaio1:amd64。
(讀取資料庫 ... 目前共安裝了 259353 個檔案和目錄。)
準備解開 .../libaio1_0.3.110-2_amd64.deb ...
解開 libaio1:amd64 (0.3.110-2) 中...
選取了原先未選的套件 mysql-client-core-5.7。
準備解開 .../mysql-client-core-5.7_5.7.24-0ubuntu0.16.04.1_amd64.deb ...
解開 mysql-client-core-5.7 (5.7.24-0ubuntu0.16.04.1) 中...
選取了原先未選的套件 mysql-client-5.7。
準備解開 .../mysql-client-5.7_5.7.24-0ubuntu0.16.04.1_amd64.deb ...
解開 mysql-client-5.7 (5.7.24-0ubuntu0.16.04.1) 中...
選取了原先未選的套件 mysql-server-core-5.7。
準備解開 .../mysql-server-core-5.7_5.7.24-0ubuntu0.16.04.1_amd64.deb ...
解開 mysql-server-core-5.7 (5.7.24-0ubuntu0.16.04.1) 中...
選取了原先未選的套件 libevent-core-2.0-5:amd64。
準備解開 .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_amd64.deb ...
解開 libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) 中...
選取了原先未選的套件 mysql-server-5.7。
準備解開 .../mysql-server-5.7_5.7.24-0ubuntu0.16.04.1_amd64.deb ...
解開 mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) 中...
選取了原先未選的套件 libhtml-template-perl。
準備解開 .../libhtml-template-perl_2.95-2_all.deb ...
解開 libhtml-template-perl (2.95-2) 中...
選取了原先未選的套件 mysql-server。
準備解開 .../mysql-server_5.7.24-0ubuntu0.16.04.1_all.deb ...
解開 mysql-server (5.7.24-0ubuntu0.16.04.1) 中...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu21.10) ...
設定 libaio1:amd64 (0.3.110-2) ...
設定 mysql-client-core-5.7 (5.7.24-0ubuntu0.16.04.1) ...
設定 mysql-client-5.7 (5.7.24-0ubuntu0.16.04.1) ...
設定 mysql-server-core-5.7 (5.7.24-0ubuntu0.16.04.1) ...
設定 libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
設定 mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
設定 libhtml-template-perl (2.95-2) ...
設定 mysql-server (5.7.24-0ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.10) ...
Processing triggers for ureadahead (0.100.0-19) ...
treehrt@treehrt-D630MT:~$

(2)$ sudo apt-get install mysql-client
:

以下套件為自動安裝,並且已經無用:
  linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic linux-image-4.10.0-28-generic linux-image-extra-4.10.0-28-generic
Use 'sudo apt autoremove' to remove them.
下列【新】套件將會被安裝:
  mysql-client
升級 0 個,新安裝 1 個,移除 0 個,有 254 個未被升級。
需要下載 10.1 kB 的套件檔。
此操作完成之後,會多佔用 110 kB 的磁碟空間。
下載:1 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client all 5.7.24-0ubuntu0.16.04.1 [10.1 kB]
取得 10.1 kB 用了 0秒 (50.9 kB/s)      
選取了原先未選的套件 mysql-client。
(讀取資料庫 ... 目前共安裝了 259610 個檔案和目錄。)
準備解開 .../mysql-client_5.7.24-0ubuntu0.16.04.1_all.deb ...
解開 mysql-client (5.7.24-0ubuntu0.16.04.1) 中...
設定 mysql-client (5.7.24-0ubuntu0.16.04.1) ...
treehrt@treehrt-D630MT:~$

(3)

$ sudo apt-get install libmysqlclient-dev
:

libmysqlclient-dev is already the newest version (5.7.24-0ubuntu0.16.04.1).
以下套件為自動安裝,並且已經無用:
  linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic linux-image-4.10.0-28-generic linux-image-extra-4.10.0-28-generic
Use 'sudo apt autoremove' to remove them.
升級 0 個,新安裝 0 個,移除 0 個,有 254 個未被升級。
treehrt@treehrt-D630MT:~$

(4)

$ sudo /etc/init.d/mysql start
[sudo] password for treehrt:
[ ok ] Starting mysql (via systemctl): mysql.service.

$ ps ax|grep mysql
 7404 ?        Ssl    0:03 /usr/sbin/mysqld
 8961 pts/20   S+     0:00 grep --color=auto mysql

(5)

$ mysql -p -uroot
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.24-0ubuntu0.16.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> quit
Bye

 

 


select id,article_id,topic,text from lt_articles_text where article_id =448; ok. update lt_articles set num_reads=num_reads +1 where id=448; ok.