Chinaunix首页 | 论坛 | 博客
  • 博客访问: 83391
  • 博文数量: 14
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 159
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-13 18:38
文章分类

全部博文(14)

文章存档

2013年(14)

分类: Mysql/postgreSQL

2013-07-19 21:16:20

首先在终端中输入:
apt-get install mysql-server mysql-client
期间会弹出一个界面,要求输入密码(是mysql的root密码).手动输入即可.
完成后,mysql会自动启动,验证:
netstat -tap |grep mysql
显示如下:
tcp        0      0 localhost:mysql         *:*                     LISTEN      10521/mysqld 
如果服务器不能正常启动,可以通过下面的命令启动:
$sudo /etc/init.d/mysql restart
接下来我们进入mysql:
mysql -u root -p
显示:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.31-0ubuntu0.12.04.2 (Ubuntu)


Copyright (c) 2000, 2013, 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.
然后输入:
show databases;
显示:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

至此mysql安装成功.

阅读(1481) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~