-
数据库报错——check the manual that corresponds to your MySQL server version for the right
2015-05-12 16:51:541、check the manual that corresponds to your MySQL server version for the right syntax to use near ') 语法错误: `turn` TINYINT(2) NULL DEFAULT NULL, PRIMARY KEY (`id`) ) -
mysql更改数据库登录密码失败;Access denied for user 'root'...mysqladmin: connect to server at 'localhos
2020-02-21 17:21:20信了如下几个报错的邪 ... “Access denied for user 'root'@'localhost'” ...“mysqladmin: connect to server at 'localhost' failed” “mysqladmin: Can't turn off logging; error: 'Access denied; you need (...信了如下几个报错的邪
mysqladmin更改密码无效
“Access denied for user 'root'@'localhost'”
“mysqladmin: connect to server at 'localhost' failed”
“mysqladmin: Can't turn off logging; error: 'Access denied; you need (at least one of) the SUPER privilege(s) for this operation'”
背景:centos6.10中安装5.5.62
解决方法:
1.kill pid #结束数据库进程
2.vi /data/3307/mysql
#启动文件文件中配置--skip-grant-tables,注释掉mysql_pwd="oldboy123",不需修改my.cnf文件
3. /data/3307/mysql start
netstat –lntup
#启动数据库并检查
4. mysql -uroot -S /data/3307/mysql.sock #进入mysql,不要带-p
执行下面的句子
mysql>use mysql;
mysql>delete from user where user='';
mysql>delete from user where host='localhost.localdomain';
mysql>update user set password=password('oldboy123') where user='root';
mysql>update user set host='%' where user='root';
#如果报错 ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会
mysql>quit;
5./data/3307/mysql stop #如果要输入密码,直接enter或者输入'oldboy123'
6.vi /data/3307/mysql #删除第1步加入的--skip-grant-tables
7. /data/3307/mysql start
netstat –lntup
#启动数据库并检查
8. mysql -uroot -S /data/3307/mysql.sock #确认不需密码是否无法登录
9. mysql -uroot -p -S /data/3307/mysql.sock #登录数据库,密码'oldboy123'
/3307/注意替换!
参考文件:
https://blog.51cto.com/holy2010/684117
-
JavaScript打印和AJAX从数据库保存/删除
2015-06-08 09:46:08<p>and these are the pages for the two server-side functions: <p><strong>delete.php</strong></p> <pre><code><?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "depits... -
使用未定义的常量项目/使用未定义的常量数据库
2014-07-09 14:28:14<p>When I submit a variable into a form and submit it to a PHP file which is in turn connected to MySQL server, this happens: <pre><code>Notice: Use of undefined constant project - assumed 'project' ... -
如何上传图像并将数据插入MySQL数据库
2016-02-16 10:28:05// turn emulated prepares off $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC); // set default fetch mode to assoc so that you don't have to explicitly list the fetch mode every ... -
str_replace不替换从数据库中提取的url
2013-07-16 20:25:01<p>I am trying to extract a filepath of an image from a MySQL database and turn it into a URL. However when I pass it through str_replace no changes are been made. I have set up a test document with a... -
通过NSURLConnection将带有php脚本的数据传递给数据库
2012-04-27 23:45:48<p>My issue is when the user tries to turn "on" 2 switches. The second switch does not end up in my database but when they only turn on 1 of them separately, they all end up in the right database like... -
将字符串拆分为零件并加载到数据库
2014-08-20 23:04:48I guess I could turn this into array, but it is still confusing how do I do it and how to make the php string to correctly put everything into right MySQL database tables.</p> <p>Edit: I have some ... -
函数参数,返回数据库表中的所有记录
2011-12-02 04:52:11<p>What I am trying to do is turn this into an argument. Somewhat like this(this is an example, please don’t judge). <p>PHP:</p> <pre><code>function getLayers(){ $my_layer_string="MyMap_".mb_... -
使用PhantomJS从数据库中检索数据并自动化PHP脚本
2015-02-20 09:09:33This is all on the server side, Linux. The only unique value is the ID, and depending on the number of the ID the webpage will change accordingly. <p>For example: <p>ID: 1, Color: Red. <p>ID: 2, ... -
从MySQL数据库检索的字符串中出现特殊字符和额外空格
2013-08-24 03:38:54This question is sent to a server which in turn sends it to my e-mail. I respond to the question and the response gets sent back to the server. The response is stored in a MySQL database. The user ... -
使用php将数据从html表单插入到mysql数据库中的数据表中
2017-03-16 23:20:46So I decided to turn to you all for help. It seems like it should be a simple solution to me but I cannot find it so maybe fresh eyes will help. So here it is I hope someone may be able to assist me.... -
通过PHP选择表格从数据库中删除条目 - 不删除条目
2013-12-11 10:17:14// turn on PDO exception handling $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { // enter catch block in event of error in preceding try block echo ... -
如何在PHP中保存文件并根据可能的故障将文件特征保存到数据库
2011-09-20 23:51:33I forgot to mention that I am interacting with the DB through an API server, so instead of directly interacting with the DB, I am sending REST requests to the API which in turn interacting with the ... -
人工智能自动sql优化工具--SQLTuning for SQL Server
2018-04-11 13:17:24SQL语句是对数据库进行操作的惟一途径,对数据库系统的性能起着决定性的作用。对于同一条件下的SQL语句写法有很多,其中一些写法往往对性能又有很大影响。但是每个人掌握SQL语言的水平不同,如何才能保证写出高性能...SQL语句是对数据库进行操作的惟一途径,对数据库系统的性能起着决定性的作用。对于同一条件下的SQL语句写法有很多,其中一些写法往往对性能又有很大影响。但是每个人掌握SQL语言的水平不同,如何才能保证写出高性能的SQL呢?针对这种情况,人工智能自动SQL优化工具应运而生。现在我就向大家介绍这样一款工具:SQLTuning for SQL Server。
1. SQL Tuning 简介
SQL Turning是Quest公司出品的Quest Central软件中的一个工具。
QuestCentral(图1)是一款集成化、图形化、跨平台的数据库管理解决方案,可以同时管理Oracle、DB2 和 SQL server 数据库。它包含了如下的多个工具:
数据库管理(DBA)
数据库监控(Monitoring Pack)
数据库诊断 (Spotlight Diagnostics)
数据库分析 (Database Analysis)
SQL优化 (SQL Tuning)
空间管理 (Space Management)
压力测试 (Load Generator)
数据生成 (Data Generator)
PL/SQL 开发 (TOAD)
专家建议 (Knowledge Expert)今天,我们只介绍其中的SQL优化(SQL Tuning for SQL Server) 的使用方法。
图1 quest central界面
2. 使用SQL Tuning 优化SQL
下面我们用SQLServer自带的Northwind数据库为例,帮助大家了解如何使用SQLTuning优化SQL。
(1)建立连接。
在QuestCentral主界面上的“Database”树上选择“SQLServer”,然后在下方出现的“Tools”框中选择“SQLTuning”选项,打开“Lanch SQL Tuning for SQL ServerConnections”对话框(图2)。我们在这里建立数据库服务器的连接,以后的分析工作都会在它上面完成。图2 “建立连接”对话框
双击“NewConnection”图标,在弹出窗口中输入数据库的信息,单击“OK”,然后单击“Connect”即可。
(2)分析原始SQL语句 。
在打开窗口的“OriangalSQL”文本框内输入需要分析的原始SQL语句,代码如下:12345678/*查询卖出价个不同的同一货物名称*/
select
DISTINCT
c.CompanyName,p.ProductName
from
[
Order
Details] od1,[
Order
Details] od2 , Orders o1 , Orderso2,Customers c, Products p
where
od1.UnitPrice<>od2.UnitPrice andod1.ProductID=od2.ProductID
and
od1.OrderID=o1.OrderID
and
od2.OrderID=o2.OrderID
and
o1.CustomerID=o2.CustomerID
and
o1.CustomerID=C.CustomerID
首先在界面左上方选择数据库,然后点击工具栏上的“Execute”按钮,执行原始的SQL语句,SQLTuning会自动分析SQL的执行计划,并把分析结果显示到界面上(图3)。
图3 分析原始SQL语句
(3)优化SQL。
现在我们点击工具栏上的“Optimize Statement”按钮,让SQLTuning开始优化SQL,完成后,可以看到SQLTuning产生了34条与原始SQL等价的优化方案(图4)。
图4 SQL优化方案
(4)获得最优SQL。
接下来,我们来执行上面产生的优化方案,以选出性能最佳的等效SQL语句。在列表中选择需要执行的优化方案(默认已全部选中),然后点击工具栏上的“Execute”按钮旁边的下拉菜单,选择“ExecuteSelected”。等到所有SQL运行完成后,点击界面左方的“TuningResolution”按钮,可以看到最优的SQL已经出来啦,运行时间竟然可以提高52%!(图5)
图5 “Tuning Resolution”界面
(5)学习书写专家级的SQL语句。
通过上面的步骤,我们已经可以实现自动优化SQL语句,但更重要的是,我们还可以学习如何书写这样高性能的SQL语句。点击界面左方的“CompareScenarios”按钮,我们可以比较优化方案和原始SQL中的任意2条SQL语句,SQLTuning会将它们之间的不同之处以不同颜色表示出来,还可以在下方的“执行计划”中,通过比较两条SQL语句的执行计划的不同,来了解其中的差异(图6)。
图6 “Compare Scenarios”界面
3.小结
SQLTuning等人工智能自动SQL优化工具的出现,为我们节省出大量的时间和精力。借助这些工具的帮助,书写专家级的SQL语句将不再是难事。
-
You can turn off interprocedural optimizations with the following parameter: -PenableLTO=false. ./gradlew assembleBase -PenableLTO=false` Note: Building the Base variant would always build realm-core....
-
palapa web server (PWS)运行于安卓系统的web服务器
2014-08-09 20:16:15Turn your Android devices into a web and database server with Palapa Web Server, a suite of web developer. This application has been designed for low memory consumption and CPU usage, specially used ... -
解决Navicat Premium连接MySQL 报错 “can‘t connect to MySQL server on unkown error”
2020-11-23 11:38:581.登入到MySQL数据库中 2.执行 use mysql;进入到mysql库 3.进入后执行 update user set host = '%' where user = 'root';语句,报错也不用理会 4.执行FLUSH PRIVILEGES;刷新MySQL的权限相关表 mysql> use mysql; ...报错
四步解决:
1.登入到MySQL数据库中
2.执行use mysql;
进入到mysql库
3.进入后执行update user set host = '%' where user = 'root';
语句,报错也不用理会
4.执行FLUSH PRIVILEGES;
刷新MySQL的权限相关表mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set host = '%' where user = 'root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
如果还是连接不上就删除连接,然后重新新建连接。
提供简单脚本
[root@mysqld01 ~]# cat navicat.sh #!/bin/bash read -p "Please enter your MySQL password:" pass mysql -uroot -p$pass << EOF use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES; EOF echo "ok!"
-
It is imperative that your server is synchronized with a time-source such as an NTP server. Especially if your server is running within a virtual machine. Why? Read more here. Do not rely on ...
-
coTurn配置(主要是客户端登录验证)及验证原理分析
2018-05-06 02:59:51想支持WebRTC服务器coTurn必须开启long-term credentials mechanism,也就是加上-a选项。..../turnserver -a --no-tls --no-dtls --no-stun -u testuser:testpwd -r myrealm -v ./turnutils_peer -v ./tu... -
Ourmsg2014
2016-03-14 20:41:28服务器端数据库采用SQLite for .net4版本,并发加入单线程队列写数据库,多线程读数据库(用户规模在万人以内完全能够应对),如果想要使用SQL Server、Oracle、My sql等数据库,请自行开发,数据结构参见服务器... -
机器人拉曼前端:用于机器人拉曼前端-源码
2021-02-13 13:43:44数据格式:{“ id”:1,/ *始终为一个/“ direction”:[1-3],/将接受任何整数,PUT以1表示Left,2表示Forward,3表示Right /“ turn”:[ 0-1],/生产者为0,使用者又为1,则将其PUT要求输入。* /} 注意:请勿... -
小白求问 怎么解决 ERROR 1406 (22001): Data too long for column 'gender' at row 1!
2019-06-01 15:16:02Server version: 5.7.25 MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its... -
求大拿帮忙啊,MySql select导出的问题
2014-08-25 05:45:06然后我在xp自己装的Mysql数据库,用黑窗口导出来的数据是下面这样的,求大神解答一下啊!为什么xp黑窗口导出来的数据不是表里面的数据呢? mysql Ver 14.14 Distrib 5.5.22, for Win32 (x86) Copyright (c) 2000, ... -
docker-sdk python container.exec命令执行 提示 命令用法不对
2021-03-12 00:41:05在容器中导入数据库的命令行: <code class="language-bash">/opt/lampp/bin/mysql -u root --password="" match_database < /opt/lampp/htdocs/sqlfile.sql </code></pre> 在命令行执行很... -
spring security cas单点登录拒绝访问
2012-06-06 12:11:192012-06-06 11:51:34,921 INFO [org.jasig.cas.web.flow.InitialFlowSetupAction] - <Setting path for cookies to: /casServer/> [/quote] [color=red][b]跳转到登录页面后输入账号密码出现cas服务端的信息... -
Sysinternals 实用程序全集 (完整版 49.2M)
2012-03-26 16:07:54This is a kernel-mode driver that demonstrates keyboard input filtering just above the keyboard class driver in order to turn caps-locks into control keys. Filtering at this level allows conversion ... -
更新yum 源 [root@bogon ~]# yum -y update.docx
2019-12-18 19:30:43You can turn off this feature to get a quicker startup with -A Database changed mysql> select User from user; +--------+ | User | +--------+ | root | | | | root | | | | root | | wpuser | +--------+ 6...