首页 \ 问答 \ 数据库密码错误解决办法

数据库密码错误解决办法

这是我的网站打开成这样了。因为昨天安装了论坛,改了下数据库密码,然后网站就打不开。我知道他的意思是说数据库名qdm0010212或密码不对。 打开FTP。我打到文件位置,然后下载到桌面用记事本打开,但是不知道在哪里改?
更新时间:2022-03-06 09:03

最满意答案

可以用httpClient 发起一个 get或者post请求然后得到返回的结果再做json的解析即可
httpClient 用法: 
1. GET 方式传递参数
//先将参数放入List,再对参数进行URL编码
List

  params = new LinkedList
 
  ();
params.add(new BasicNameValuePair("param1", "数据"));    //增加参数1
params.add(new BasicNameValuePair("param2", "value2"));//增加参数2
String param = URLEncodedUtils.format(params, "UTF-8");//对
  参数编码
String baseUrl = "服务器接口完整URL";
HttpGet getMethod = new HttpGet(baseUrl + "?" + param);//将URL与参数拼接
HttpClient httpClient = new DefaultHttpClient();
try {
HttpResponse response = httpClient.execute(getMethod); //发起GET请求
Log.i(TAG, "resCode = " + response.getStatusLine().getStatusCode()); //获取响应码
Log.i(TAG, "result = " + EntityUtils.toString(response.getEntity(), "utf-8"));//获取服务器响应内容
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

2. POST方式 方式传递参数
//和GET方式一样,先将参数放入List
params = new LinkedList
  
   ();
params.add(new BasicNameValuePair("param1", "Post方法"));//增加参数1
params.add(new BasicNameValuePair("param2", "第二个参数"));//增加参数2
try {
HttpPost postMethod = new HttpPost(baseUrl);//创建一个post请求
postMethod.setEntity(new UrlEncodedFormEntity(params, "utf-8")); //将参数填入POST Entity中
HttpResponse response = httpClient.execute(postMethod); //执行POST方法
Log.i(TAG, "resCode = " + response.getStatusLine().getStatusCode()); //获取响应码
Log.i(TAG, "result = " + EntityUtils.toString(response.getEntity(), "utf-8")); //获取响应内容
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
  
 

相关问答

更多
  • 可以用httpClient 发起一个 get或者post请求然后得到返回的结果再做json的解析即可 httpClient 用法: 1. GET 方式传递参数 //先将参数放入List,再对参数进行URL编码 List params = new LinkedList (); params.add(new BasicNameValuePair("param1", "数据")); //增加参数1 params.add(new BasicNameValuePair("param2", "value2"));//增 ...
  • 您需要解析XML以获取字符串元素的值,即JSON数组。 然后将JSON数组发送到JSON解析器。 如果您想知道如何解析XML,那么这是一个很好的NSXML教程 。 You need to parse the XML to get the value of the string element, which is the JSON array. Then you send the JSON array into the JSON parser. If you want to know how to parse ...
  • 在非常大的数据集中,XML会稍微重一些,因为它需要打开和关闭标记。 还有一个问题是标签之间的数据有多大。 如果在开始和结束标记之间有大量数据,那么这会“软化”效果。 如果您没有处理大量数据,那么我只会使用对客户端和服务器都有更好的本机库支持。 对于中小型数据集,我认为差异不会很明显。 In very large data sets XML will be slightly heavier because it needs opening and closing tags. There is also the ...
  • 我自己想出了答案。 (比我想象的要容易) 如果我猜测它没有缓冲(我不知道什么时候缓冲某些东西)但是它有效。 public class SafeHttpHeaderReader { public static final int MAX_READ = 8*1024; private InputStream stream; private int bytesRead; public SafeHttpHeaderReader(InputStream stream) ...
  • Json操作结果已经存在。 MvcContrib具有您可以返回的XML操作结果,或者您可以使用Content(xmlContent,“text / xml”)作为您的操作结果。 您可以查询accept头以确定您希望返回哪个操作结果。 只要您的操作方法返回类型ActionResult,它返回的是哪种类型并不重要。 也就是说,一旦你证明了整体概念,有更好的方法来构建你想要做的事情。 A Json action result already exists. MvcContrib has an XML action ...
  • 如果你想访问有效负载中的基本信息,你可以使用LINQ(new-school)或XmlDocument(old-school)解析返回的XML。 如果您希望将整个响应视为强类型对象,请查看创建自己的类并将请求反序列化为这些对象。 这可能会稍微复杂一些,但也可以提供强大的打字以处理来自服务提供者的更改(您将知道它何时中断)。DataContractSerializer类(用于WCF)提供了最快速和最高效的串行器。 Net Framework作为参考点。 基于陈述的理由,我的偏好是强类型对象。 You can p ...
  • 我认为你应该使用Accept头来代替: let headers = new Headers({ 'Accept': 'application/json' }); let options = new RequestOptions({ headers: headers }); return this._http.get(_tileUrl, options) .map((response: Response) => response.json()) .catc ...
  • 你做过序列化了吗? TestRootObject testRootObject = new TestRootObject(); ...................... ..............YOUR CODE.............. .................. System.Web.Script.Serialization.JavaScriptSerializer oSerializer = new System.W ...
  • 不 - 它不会创造任何不存在的东西。 在您的情况下,如果XML更复杂,该怎么办? 没有这样一个元素可能存在的“位置”的上下文 - 因此即使它想要它也无法创建它。 解决方案是在需要时通过添加一个元素来修复内容 - 或者将其转换为json-basic命名空间 - 其中这些元素位于标记为数组的元素内部(可以为空) - 或者第三,使用XSD暗示处理器该做什么。 但是仍然需要'数组'的包含元素 - 然后项目将是minOccurance = 0。 但如果是这种情况,那么修复和转换为json / basic命名空间对于您 ...
  • 只需按需要对其进行编码,然后将其回显到页面即可。 你的$ data =将包含回显的内容。 个人喜好是使用JSON,因为它很容易丢弃。 如在 //Bunch of DB stuff.. $row=mysql_fetch_however_you_handle_it(); echo json_encode($row); //on your receiving end, that just did the cURL send, $row=json_decode($data,true);//decode the ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)