当前位置: 首页 > news >正文

中国住房和城乡建设部网站官网怎么做兼职网站

中国住房和城乡建设部网站官网,怎么做兼职网站,长沙网站排名技术,建设网站 创建数据库目录 一.检查mysql是否安装 1. 查看文件安装路径 2. 查询运行文件所在路径(文件夹地址) 二.登录mysql 三.列出mysql全部用户 四.常用指令 1.查看全部数据库 2.选择数据库 …

目录

一.检查mysql是否安装

1.  查看文件安装路径

2.  查询运行文件所在路径(文件夹地址)

二.登录mysql

三.列出mysql全部用户

四.常用指令

1.查看全部数据库

 2.选择数据库

3.查看该数据库的全部数据表

4.显示表结构

5.运行sql文件

6.显示数据库概况

五.查看帮助指令

一.检查mysql是否安装

1.  查看文件安装路径

# gr @ gr-System-Product-Name in ~ [10:05:21] 
$ whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/man/man1/mysql.1.gz

2.  查询运行文件所在路径(文件夹地址)

# gr @ gr-System-Product-Name in ~ [10:05:26] 
$ which mysql     
/usr/bin/mysql

二.登录mysql

# gr @ gr-System-Product-Name in ~ [10:36:49] 
$ mysql -u用户名 -p密码
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 55
Server version: 8.0.32 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.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> 

三.列出mysql全部用户

必须要用root账户登录,进入mysql环境

# gr @ gr-System-Product-Name in ~ [10:39:50] 
$ mysql -uroot -p密码
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 56
Server version: 8.0.32 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.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> 
mysql> SELECT User, Host FROM mysql.user;
+------------------+-----------+
| User             | Host      |
+------------------+-----------+
| ga               | %         |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
5 rows in set (0.00 sec)

四.常用指令

1.查看全部数据库

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

 2.选择数据库

mysql> use mysql;
Database changed

3.查看该数据库的全部数据表

mysql> show tables;
+------------------------------------------------------+
| Tables_in_mysql                                      |
+------------------------------------------------------+
| columns_priv                                         |
| component                                            |
| db                                                   |
| default_roles                                        |
| engine_cost                                          |
| func                                                 |
| general_log                                          |
| global_grants                                        |
| user                                                 |
+------------------------------------------------------+
38 rows in set (0.00 sec)

4.显示表结构

mysql> desc user;

5.运行sql文件

mysql> use mysql
Database changed
mysql> source /user/test.sql

6.显示数据库概况

  当前使用的数据库,当前用户,mysql版本信息

mysql> status
--------------
mysql  Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL)Connection id:		59
Current database:	mysql
Current user:		root@localhost
SSL:			Not in use
Current pager:		less
Using outfile:		''
Using delimiter:	;
Server version:		8.0.32 MySQL Community Server - GPL
Protocol version:	10
Connection:		Localhost via UNIX socket
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8mb4
Conn.  characterset:	utf8mb4
UNIX socket:		/var/run/mysqld/mysqld.sock
Binary data as:		Hexadecimal
Uptime:			5 days 2 min 4 secThreads: 4  Questions: 2198  Slow queries: 0  Opens: 580  Flush tables: 3  Open tables: 499  Queries per second avg: 0.005
--------------

五.查看帮助指令

mysql> \?For information about MySQL products and services, visit:http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:https://shop.mysql.com/List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
resetconnection(\x) Clean session context.
query_attributes Sets string parameters (name1 value1 name2 value2 ...) for the next query to pick up.
ssl_session_data_print Serializes the current SSL session data to stdout or fileFor server side help, type 'help contents'

六.权限问题

1.查询某用户的权限

mysql> show grants for 'ga'@'%';
+---------------------------------------------------+
| Grants for gauture@%                              |
+---------------------------------------------------+
| GRANT USAGE ON *.* TO `ga`@`%`                    |
| GRANT ALL PRIVILEGES ON `table01`.* TO `ga`@`%`   |
| GRANT ALL PRIVILEGES ON `table01`.* TO `ga`@`%`   |
+---------------------------------------------------+
3 rows in set (0.00 sec)

2.给用户添加权限

mysql> GRANT ALL PRIVILEGES ON test.* TO 'ga'@'%';
Query OK, 0 rows affected (0.01 sec)

七.退出

mysql> exit
Bye

http://www.yayakq.cn/news/677600/

相关文章:

  • 用易语言做攻击网站软件下载书籍教你如何做网站
  • 那个视频网站可以做桌面背景ui设计师找工作
  • 石大远程网页设计与网站建设答案成都品牌设计策划
  • 网络工程师培训机构排名淘宝seo是指什么
  • 页面升级紧急通知班级优化大师官网下载
  • 南京百度网站快速优化申请域名建立网站
  • 一个网站开发的流程代写稿子的平台
  • 建筑公司网站管理员网站怎么做区域性优化
  • 中山网站排名网站速度的重要性
  • 网站免费加速器怎么用wordpress建手机网站
  • 快消品网站建设什么网站做美食最好最专业
  • 什么是网站反向链接有用建站宝盒做网站的吗
  • 福州网站排名优化公司网站的建设哪家好
  • 专门做投票的网站有哪些东莞市朝阳信息网络有限公司
  • 网站推广应该注意什么做办公用品网站资料怎么收集
  • 专业网站定制流程东莞专业做网站建设服务
  • 泰安建材网站建设电话景点介绍网站模板
  • 怎么做免费网站被收录wordpress 设置权限设置
  • 2018网站建设涉及wordpress高端展示中文主题
  • 网站备案的时候可以做网站吗html网站源码下载
  • 网站怎么挣钱郑州做网站优化外包
  • 有后台管理系统网站管理网站建设5000费用
  • 做淘宝客建网站要多少费用深圳网站建设策划方案
  • 网站开发net教程莞城网站制作
  • 网站200m虚拟主机能放多少东西中国十大门户类网站
  • 一个网站的后台自贸区网站建设
  • 银川做淘宝网站的大型手机网站制作
  • 现在用什么做网站网站建设有生意吗
  • 五河网站建设哪家好网站建设工具的公司
  • 怎么样可以自己做网站网页设计背景图