设为首页 加入收藏

TOP

CentOS 7上编译安装MySQL 5.5(五)
2018-12-02 22:09:18 】 浏览:439
Tags:CentOS 编译 安装 MySQL 5.5
eload


(3)使用systemctl启动mysqld服务,并查看其运行状态。


[root@localhost ~]# systemctl start mysqld.service
[root@localhost ~]# netstat -anpt | grep 3306
tcp6      0      0 :::3306                :::*                    LISTEN      6662/mysqld 


?访问MySQL数据库



1. 登录到MySQL服务器


经过安装后的初始化过程,MySQL数据库的默认管理员用户名为“root”,密码为空。
可以使用mysqladmin命令设置mysql的密码。


[root@localhost ~]# mysqladmin -u root -p password "123abc"
Enter password:      #输入mysql的原始密码为空
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.


[root@localhost ~]# mysql -u root -p  #输入该命令,进入数据库
Enter password:    #输入设置的密码123abc
............        #省略内容


mysql>


2.执行MySQL操作语句


(1)查看当前服务器中有哪些库


mysql> show databases;
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test              |
+--------------------+
5 rows in set (0.00 sec)


(2) 查看当前使用的库中有那些表
先使用USE语句切换到所使用的库,再用mysql> TABLES语句用于查看当前所在的库中包含的表。


mysql> use mysql;  #切换到mysql库
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql          |
+---------------------------+
| columns_priv              |
| db                        |
| engine_cost              |
| event                    |
| func                      |
| general_log              |
| gtid_executed            |
| help_category            |
| help_keyword              |
| help_relation            |
| help_topic                |
| innodb_index_stats        |
| innodb_table_stats        |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| server_cost              |
| servers                  |
| slave_master_info        |
| slave_relay_log_info      |
| slave_worker_info        |
| slow_log                  |
| tables_priv              |
| time_zone                |
| time_zone_leap_second    |
| time_zone_name            |
| time_zone_

首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL用全库备份数据恢复单表数据 下一篇PostgreSQL之Foreign Data Wrappe..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目