Ubuntu下mysql-server的安装

(1)更新

#apt-get update

(2)安装

#apt-get install mysql-server
出现窗口设置"root"用户的密码为"456456"

(3)启动

#service mysql start
正常 出现mysql start/running, process 4429
已运行 出现start: Job is already running: mysql
停止 命令#service mysql stop 正常 出现mysql stop/waiting

(4)查看是否安装成功

#netstat -tap | grep mysql
正常 出现    //需要启动mysql
tcp        0      0 localhost:mysql         *:*                     LISTEN      4429/mysqld 
如果看到有mysql 的socket处于 listen 状态则表示安装成功

(5)登录

#mysql -u root -p  //以root身份登录
Enter password: 456456    //要求输入root账户的密码        
正常 出现
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.5.46-0ubuntu0.12.04.2 (Ubuntu)

Copyright (c) 2000, 2015, 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> 

(6)查看当前的数据库

mysql> show databases;
获取信息如下:

+--------------------+
| Database |
+--------------------+
| information_schema |
| freeradius |
| mysql |
| performance_schema |
| radius |
+--------------------+
5 rows in set (0.02 sec)

mysql> 

(7)选择performance_schema数据库就行下一步操作,使用use performance_schema命令,显示当前数据库的表单

mysql> use performance_schema 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+----------------------------------------------+
| Tables_in_performance_schema                 |
+----------------------------------------------+
| cond_instances                               |
| events_waits_current                         |
| events_waits_history                         |
| events_waits_history_long                    |
| events_waits_summary_by_instance             |
| events_waits_summary_by_thread_by_event_name |
| events_waits_summary_global_by_event_name    |
| file_instances                               |
| file_summary_by_event_name                   |
| file_summary_by_instance                     |
| mutex_instances                              |
| performance_timers                           |
| rwlock_instances                             |
| setup_consumers                              |
| setup_instruments                            |
| setup_timers                                 |
| threads                                      |
+----------------------------------------------+
17 rows in set (0.00 sec)

mysql> 

 

posted on 2016-03-14 16:48  懒懒的小猪 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lldxz/p/5276269.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值