说明:按照一下步骤,从无到有成功安装myql需要时间小于2分钟 !
Ubunta 操作系统在线安装mysql-server-core-5.5与mysql-client-5.5
阿里云服务器ECS.配置:1核/2G 、Ubuntu 14.04、1M带宽 。注:物理机(非租用的云服务器,安装应该更快,具体多快,没有测试过)
1、更新相关在线安装包信息 (Update package information from the MySQL APT repository with the following command (this step is mandatory):
# sudo apt-get update
2、安装mysql客户端与服务器端
# sudo apt-get install mysql-server mysql-client
注:1)、安装过程中,出现如下提示后,需要输入y。
"After this operation, 96.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y "
2)、输入mysql root用户密码。
3、让mysql支持其他应用服务,这里以APACHE服务为例
安装相关支持组建即可
# sudo apt-get install libapache2-mod-auth-mysql
4、mysql基本使用命令
1)登录命令 mysql -u root -p
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
2) 服务启动、停止与状态查询命令
# sudo service mysql start
# sudo service mysql stop
# sudo service mysql status
1、mysql官网APT-GET说明
http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/#apt-repo-fresh-install
2、mysql安装文档
http://jingyan.baidu.com/article/425e69e6bbc6c7be14fc1640.html