如何在ubuntu14.04 LTS(Trusty Tahr)上安装mysql server 5.6

时间:2019-08-20 17:58:23  来源:igfitidea点击:

MySQL是一个开源的关系数据库管理系统(RDBMS)。
它广泛应用于LAMP(Linux、Apache、MySQL、PHP)栈和web应用程序中。
这是一个最可靠的数据库,许多公司都在使用它。

安装MySQLServer5.6的步骤:

安装MySQL Server 5.6

使用apt-get命令安装mysql server 5.6.

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

登录MySQL Server

mysql服务器安装完成后,会自行启动mysql服务。因此,现在可以使用root用户登录MySQL服务器。

Hyman@ubuntu:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 36
Server version: 5.6.17-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.04 sec)

mysql> exit
Bye

MySQL服务启动/停止/重启/查看状态

(a) 重新启动mysql服务

sudo service mysql restart

(b) 启动mysql服务

sudo service mysql start

(c) 停止mysql服务

sudo service mysql stop

(c) 获取mysql服务的状态

sudo service mysql status