当前位置首页 > Ubuntu知识

ubuntu安装/卸载mysql

阅读次数:290 次  来源:admin  发布时间:

1.安装mysql

root@openstack001:/tmp# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libaio1 mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  libaio1 mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 4 newly installed, 0 to remove and 200 not upgraded.
Need to get 0 B/5,291 kB of archives.
After this operation, 53.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package libaio1:amd64.
(Reading database ... 56783 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.109-4_amd64.deb ...
Unpacking libaio1:amd64 (0.3.109-4) ...
Selecting previously unselected package mysql-server-core-5.5.
Preparing to unpack .../mysql-server-core-5.5_5.5.53-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-core-5.5 (5.5.53-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-server-5.5.
Preparing to unpack .../mysql-server-5.5_5.5.53-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-5.5 (5.5.53-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.53-0ubuntu0.14.04.1_all.deb ...
Unpacking mysql-server (5.5.53-0ubuntu0.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libaio1:amd64 (0.3.109-4) ...
Setting up mysql-server-core-5.5 (5.5.53-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.5 (5.5.53-0ubuntu0.14.04.1) ...
161231 15:56:18 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
161231 15:56:18 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
161231 15:56:18 [Note] /usr/sbin/mysqld (mysqld 5.5.53-0ubuntu0.14.04.1) starting as process 16340 ...
mysql start/running, process 16472
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mysql-server (5.5.53-0ubuntu0.14.04.1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
root@openstack001:/tmp# 

2.查看mysql信息

root@openstack001:/tmp# dpkg -l | grep mysql
ii  libdbd-mysql-perl                   4.025-1ubuntu0.1              amd64        Perl5 database interface to the MySQL database
ii  libmysqlclient18:amd64              5.5.53-0ubuntu0.14.04.1       amd64        MySQL database client library
ii  mysql-client                        5.5.53-0ubuntu0.14.04.1       all          MySQL database client (metapackage depending on the latest version)
ii  mysql-client-5.5                    5.5.53-0ubuntu0.14.04.1       amd64        MySQL database client binaries
ii  mysql-client-core-5.5               5.5.53-0ubuntu0.14.04.1       amd64        MySQL database core client binaries
ii  mysql-common                        5.5.53-0ubuntu0.14.04.1       all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                        5.5.53-0ubuntu0.14.04.1       all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.5                    5.5.53-0ubuntu0.14.04.1       amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.5               5.5.53-0ubuntu0.14.04.1       amd64        MySQL database server binaries
root@openstack001:/tmp# 

3.卸载mysql

root@openstack001:/tmp# apt-get autoremove --purge mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
yThe following packages will be REMOVED:
  libaio1* mysql-server* mysql-server-5.5* mysql-server-core-5.5*
0 upgraded, 0 newly installed, 4 to remove and 200 not upgraded.
After this operation, 53.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 56968 files and directories currently installed.)
Removing mysql-server (5.5.53-0ubuntu0.14.04.1) ...
Removing mysql-server-5.5 (5.5.53-0ubuntu0.14.04.1) ...
mysql stop/waiting
Purging configuration files for mysql-server-5.5 (5.5.53-0ubuntu0.14.04.1) ...
Removing mysql-server-core-5.5 (5.5.53-0ubuntu0.14.04.1) ...
Removing libaio1:amd64 (0.3.109-4) ...
Purging configuration files for libaio1:amd64 (0.3.109-4) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for libc-bin (2.19-0ubuntu6) ...
上一篇:隐藏tomcatnginx版本信息
下一篇:解决org.apache.ibatis.binding.BindingException:Invalidboundstateme