localhost

PHP连接MySQL数据库的几种方法

有些话、适合烂在心里 提交于 2019-12-03 23:49:08
1.最简单的方式-mysql(面向过程) <?php $con = mysql_connect("localhost","root","password"); $select_db = mysql_select_db('test'); if (!$select_db) { die("could not connect to the db:\n" . mysql_error()); } //查询代码 $sql = "select * from db_table"; $res = mysql_query($sql); if (!$res) { die("could get the res:\n" . mysql_error()); } while ($row = mysql_fetch_assoc($res)) { print_r($row); } //查询代码 //关闭数据库连接 mysql_close($con); ?> 2.新的方式-mysqli(面向过程) $mysql_server_name = 'localhost'; //改成自己的mysql数据库服务器 $mysql_username = 'root'; //改成自己的mysql数据库用户名 $mysql_password = 'password'; //改成自己的mysql数据库密码 $mysql_database =

Ocelot简易教程(三)之主要特性及路由详解

自闭症网瘾萝莉.ら 提交于 2019-12-03 23:44:27
作者:依乐祝 原文地址: https://www.cnblogs.com/yilezhu/p/9664977.html 上篇《Ocelot简易教程(二)之快速开始2》教大家如何快速跑起来一个ocelot实例项目,也只是简单的对Ocelot进行了配置,这篇文章会给大家详细的介绍一下Ocelot的配置信息。希望能对大家深入使用Ocelot有所帮助。 上篇中也提到了,最简单的Ocelot如下面所示,只有简单的两个节点,一个是 ReRoutes ,另一个就是 GlobalConfiguration 关于这两个节点的作用,上篇也已经讲述了,这里再简单的讲下ReRoutes:告诉Ocelot如何处理上游的请求。GlobalConfiguration:顾名思义就是全局配置,此节点的配置允许覆盖ReRoutes里面的配置,你可以在这里进行通用的一些配置信息。 { "ReRoutes": [], "GlobalConfiguration": {} } 下面呢给出ReRoute 的所有的配置信息,当然在实际使用的时候你没有必要全部进行配置,只需要根据你项目的实际需要进行相关的配置就可以了。 "ReRoutes": [ { "DownstreamPathTemplate": "/api/{everything}",//下游路由模板 "UpstreamPathTemplate": "/good/

Ocelot简易教程(二)之快速开始2

自作多情 提交于 2019-12-03 23:39:15
为什么这篇的标题叫“Ocelot简易教程(二)之快速开始2”呢,因为很多朋友跟我说上一篇“ Ocelot简易教程(二)之快速开始1”内容太少了,只是简单介绍Ocelot的一些简单配置,让Ocelot能跑起来!所以才有了这篇快速开始2.在这篇文章中,我会一步一步记录怎么跑起来一个Ocelot项目,并简单的介绍一下Ocelot怎么实现接口间的负载均衡!此篇文章的代码我会放在我的github上面。后续深入的记录Ocelot的使用的时候也会沿用这次的代码。 Ocelot简易教程目录 Ocelot简易教程(一)之Ocelot是什么 Ocelot简易教程(二)之快速开始1 Ocelot简易教程(二)之快速开始2 Ocelot简易教程(三)之主要特性及路由详解 Ocelot简易教程(四)之请求聚合以及服务发现 Ocelot简易教程(五)之集成IdentityServer认证以及授权 Ocelot简易教程(六)之重写配置文件存储方式并优化响应数据 Ocelot简易教程(七)之配置文件数据库存储插件源码解析 本文作者:依乐祝 原文地址: https://www.cnblogs.com/yilezhu/p/9638417.html 一步一步开始 演示项目概述 这次的演示项目因为要实现Ocelot的负载均衡的功能,因此至少需要三个项目:Ocelot网关,OrderApi,GoodApi .名字随便取的

neo4j

寵の児 提交于 2019-12-03 23:19:53
neo4j图形数据库 一、下载 https://neo4j.com/download/ neo4j-community-3.5.12 二、安装 1.需要配置java环境 2.配置neo4j系统变量 NEO4J_HOME -> C:\neo4j\neo4j-community-3.5.12 3.配置neo4j环境变量 Path中添加%NEO4J_HOME%\bin 4.验证是否安装成功 C:\Users\daiszhan>neo4j.bat console 2019-11-07 03:08:25.943+0000 INFO ======== Neo4j 3.5.12 ======== 2019-11-07 03:08:25.991+0000 INFO Starting... 2019-11-07 03:08:30.949+0000 INFO Bolt enabled on 127.0.0.1:7687. 2019-11-07 03:08:33.013+0000 INFO Started. 2019-11-07 03:08:34.157+0000 INFO Remote interface available at http://localhost:7474/ 5.通过访问http://localhost:7474 默认跳转到 http://localhost:7474/browser

Mac OS安装GTK+3.0

一世执手 提交于 2019-12-03 21:15:33
1、确保mac下的Command Line Tools已经安装: localhost:~ $ xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates localhost:~ $ 2、安装X11 Server,官网: https://www.xquartz.org/ 下载地址:https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg 下载之后手工安装即可。 3、安装Homebrew(如果已经安装了,这里忽略): /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 4、查看brew的版本 localhost:~ $ brew -v Homebrew 2.1.2 Homebrew/homebrew-core (git revision 860e; last commit 2019-05-20) localhost:~ $ 5、安装pkg-config localhost:~ $ brew

Can't determine basedir from my_print_defaults mysqld

做~自己de王妃 提交于 2019-12-03 21:15:17
我的环境是:centos7 + mysql5.7.26,今天在用 mysqldumpslow 命令查看慢查询日志时出现下面的错误 [root@localhost ~]# mysqldumpslow -t 1 Can't determine basedir from 'my_print_defaults mysqld' output: --server-id=1 --port=3306 --character_set_server=utf8 --collation-server=utf8_general_ci --lower_case_table_names=1 ...省略 翻译过来的意思是: 无法从 'my_print_defaults mysqld' 输出中确定 basedir(mysql的安装目录) ,原因是因为在安装 mysql 时没有设置 basedir 参数,也就是 mysql 的安装路径。 从网上找到的办法有的是需要执行 mysql_install_db 命令 mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data & 还有的需要修改环境变量等等。 因为我的现在运行的 mysql 是用 rpm 包安装的,安装时安装目录是系统自动分配的,数据库目录

【CentOS 7Tomcat配置5】,Tomcat日志#180121

我的未来我决定 提交于 2019-12-03 21:10:01
hellopasswd Tomcat日志 ls /usr/local/tomcat/logs 其中catalina开头的日志为tomcat的综合日志,他记录tomcat服务相关信息,也会记录错误日志 其中catalina.日期.log和catalina.out内容相同,前者会每天生成一个新的日志 host-manager和manager为管理相关的日志,其中host-manager为虚拟主机的管理日志 localhost和localhost_access为虚拟主机相关日志,其中带access字样的日志为访问日志,不带access字样的为默认虚拟主机的错误日志 访问日志默认不会生成,需要server.xml中配置一下 [root@localhost ~]# ls /usr/local/tomcat/logs/ catalina.2018-01-17.log host-manager.2018-01-17.log localhost.2018-01-21.log manager.2018-01-17.log catalina.2018-01-21.log host-manager.2018-01-21.log localhost_access_log.2018-01-17.txt manager.2018-01-21.log catalina.out localhost.2018-01

Localhost not working on XAMPP - both service apache & mysql are fine

萝らか妹 提交于 2019-12-03 21:01:00
My xampp installation 1.7.1 does not seem to work. http://localhost returns not found error. Xampp Control panel shows both mysql & apache service running fine. I'am on windows vista. Frustrated since past 2 weeks to find a solution to this. Any pointers and support will be appreciated! Thanks a ton folks. I struggled for days figuring out why I was getting a blank screen while using xampp. The cultprit was skype. Always turn of skype when you want to use localhost. le dorfier In your "xampp" menu group, one of the items is "Port Checking". If I run it, I get: *********************************

docker running splash container but localhost does not load (windows 10)

浪子不回头ぞ 提交于 2019-12-03 20:54:19
I am following this tutorial to use splash to help with scraping webpages.I installed Docker toolbox and did these two steps: $ docker pull scrapinghub/splash $ docker run -p 5023:5023 -p 8050:8050 -p 8051:8051 scrapinghub/splash I think it is running correctly, based on the prompted message in Docker window, which looks like this: However, when I open the `localhost:8050' in a web browser, it says the localhost is not working. What might have gone wrong in this case? Thanks! VonC You have mapped the port to your docker host (the VM), but you have not port-forwarded that same port to your

微软的分布式应用框架 Dapr Helloworld

纵然是瞬间 提交于 2019-12-03 20:43:48
Dapr HelloWorld Dapr Distributed Application Runtime. An event-driven, portable runtime for building microservices on cloud and edge. 分布式应用运行时、事件驱动、为云和边缘构建微服务提供便携化运行时。 我现在也不是很懂。 dapr/dapr GitHub Dapr is a portable, serverless, event-driven runtime that makes it easy for developers to build resilient, stateless and stateful microservices that run on the cloud and edge and embraces the diversity of languages and developer frameworks. Dapr codifies the best practices for building microservice applications into open, independent, building blocks that enable you to build portable applications with