linux系统安装数据库时,xshell工具常用MySQL(5.5)相关命令
2016-09-13 16:48
1036 查看
1、进入mysql数据库
[root@centos6 /]# mysql -u root -p
Enter password: root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2011, 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>
2、查看数据库编码
mysql> show variables like 'character%';
3、分页查看my.cnf文件
[root@centos6 ~]# cd /etc/
[root@centos6 etc]# more my.cnf
然后按space空格键进行下一页翻页,翻到最后按space时候会自动回到命令根目录[root@centos6 etc]#
4、分页查看文件目录(固定页数)
例如查看/etc目录下的子目录,每页显示5条信息文件
[root@centos6 etc]# ls -l | more -5
5、停止、启动、重启mysql服务
[root@centos6 etc]# service mysql stop
Shutting down MySQL... [确定]
[root@centos6 etc]# service mysql start
Starting MySQL... [确定]
[root@centos6 etc]# service mysql restart
Shutting down MySQL. [确定]
Starting MySQL.. [确定]
[root@centos6 etc]#
6、退出mysql
mysql> quit
7、查看MySQL版本
[root@centos6 /]# mysql --version
mysql Ver 14.14 Distrib 5.5.18, for Linux (x86_64) using readline 5.1
8、[root@centos6 etc]# vi my.cnf
这个命令没任何作用,用完后需用“:quit”然后按回车(Enter)退出到命令根目录[root@centos6 etc]#
9、查看mysql的位置
[root@centos6 /]# whereis mysql
10、查看mysql占用的端口号
mysql> show variables like 'port';
11、查看mysql的监听、端口、及连接
[root@centos6 /]# netstat -apn|grep mysql
12、创建数据库
mysql> create database xxx;
[root@centos6 /]# mysql -u root -p
Enter password: root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2011, 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>
2、查看数据库编码
mysql> show variables like 'character%';
3、分页查看my.cnf文件
[root@centos6 ~]# cd /etc/
[root@centos6 etc]# more my.cnf
然后按space空格键进行下一页翻页,翻到最后按space时候会自动回到命令根目录[root@centos6 etc]#
4、分页查看文件目录(固定页数)
例如查看/etc目录下的子目录,每页显示5条信息文件
[root@centos6 etc]# ls -l | more -5
5、停止、启动、重启mysql服务
[root@centos6 etc]# service mysql stop
Shutting down MySQL... [确定]
[root@centos6 etc]# service mysql start
Starting MySQL... [确定]
[root@centos6 etc]# service mysql restart
Shutting down MySQL. [确定]
Starting MySQL.. [确定]
[root@centos6 etc]#
6、退出mysql
mysql> quit
7、查看MySQL版本
[root@centos6 /]# mysql --version
mysql Ver 14.14 Distrib 5.5.18, for Linux (x86_64) using readline 5.1
8、[root@centos6 etc]# vi my.cnf
这个命令没任何作用,用完后需用“:quit”然后按回车(Enter)退出到命令根目录[root@centos6 etc]#
9、查看mysql的位置
[root@centos6 /]# whereis mysql
10、查看mysql占用的端口号
mysql> show variables like 'port';
11、查看mysql的监听、端口、及连接
[root@centos6 /]# netstat -apn|grep mysql
12、创建数据库
mysql> create database xxx;
相关文章推荐
- 在Linux系统下安装大于mysql5.5版本的数据库
- Linux 常见的系统管理 + 网络管理 + 常用工具指令(简单的程序安装,如MySQL)
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux系统下启动MySQL的命令及相关知识
- linux学习使用总结-linux系统的安装和与windows双系统共享,linux常用的基本命令,今天贴在这里和大家分享
- Linux系统下启动MySQL的命令及相关知识
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、磁盘的使用情况相关的命令和工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍 推荐
- 文件系统管理 之 Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux系统下MySQL相关命令
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
- Linux系统下启动MySQL的命令及相关知识